Code:
#!/usr/bin/perl -w use strict; use warnings; use MIME::Lite; my $DirPath='filepath'; opendir (DIR, "$DirPath") or die "Cannot open $DirPath $!\n";
system($recent) ;
Now i am getting required filename but i want to mail contents of that file in a mail as a attachment.