my $file_mdtm = $f->mdtm($file) or die "Can't find $file in $dir\n"; my $five_days = 3600*24*5; # five days in seconds if (time - $file_mdtm >= $five_days) { print "$file is more than 5 days old\n"; }