... my $newfilefound=0; $localtimenoformat=time; for $file (@files) { $mdtmnoformat=$ftp->mdtm($file); unless ( ($localtimenoformat - $mdtmnoformat) > 3600 ) { $newfilefound++; } } if (not $newfilefound) { envia_mail(); }