Use a boolean variable to remember whether you found one or more newer files. After the loop this boolean variable tells you what you want to know. Since it is not strictly a boolean variable it also tells you how many newer files it found
... my $newfilefound=0; $localtimenoformat=time; for $file (@files) { $mdtmnoformat=$ftp->mdtm($file); unless ( ($localtimenoformat - $mdtmnoformat) > 3600 ) { $newfilefound++; } } if (not $newfilefound) { envia_mail(); }
In reply to Re: Newbie: need algorithm to evaluate no file exist
by jethro
in thread Newbie: need algorithm to evaluate no file exist
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |