foreach my $file (@filelist) { if ( int( -M $file ) < 1 ) { # do something with a file } }