when i run this the print function will print the same filename for as many times as there are files it globbed, and doesn't make it into my email. LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT LT-AG4437_AH66-FLAT#!/usr/bin/env perl use Net::FTP; use File::Copy; use Mail::Sender; use Net::SMTP; my $TIFFfolder = "/Volumes/photorepos/Partners/LTBrands/post/DONE_PSDs +/"; chdir( $TIFFfolder ) or warn "Cant chdir to $TIFFfolder $!"; my(@TIFFfolder_list) = glob "*.psd"; print "$date $time Removing any Thumbs.db files from $TIFFfolder\n"; if ( -e "Thumbs.db") { unlink ("Thumbs.db") or warn "thumbs.db is being a pain in the ass: $! +\n"; } my $TIFFapproval = @TIFFfolder_list; foreach $file (@TIFFfolder_list){ my $file = basename (@TIFFfolder_list, ".psd"); print "$file\n"; } $mail->send(-to=>"$to", -from=>"$from", -subject=>"$subject", -body=>" +$file", -contenttype=>"text/html"); $mail->bye;
In reply to using basename on a list of filesnames by flieckster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |