I have a PERL script that reads and writes to a excel file in UNIX. After writing to the excel file, it saves a copy in one of the sub directories called 'Output'.
I need help in sending the contents of this Output folder as an atachment to a particular user in a form of an email.
Following is a part of the script:
use Net:

MTP;
use Mail:

ender;
my $sender;
opendir DIRH, "output" or die "couldn't open: $!";
foreach (sort readdir DIRH)
{
print ("$_ \n");
if ($_ =~ /xls$/) {
$sender = new Mail:

ender {smtp => 'mailhost.company.com', from => 'Auto Excel <first_name.last_name@company.com>'};
$sender ->MailFile({to => 'recipent.dude@company.com',
subject => 'Auto Excel Results',
msg => "\nThe latest results have been run.\n\nResults are attached.",
file => "output\\$_"
});
}
}