my $file; if (-M $file == 7) # -M file test op checks for last modification. For more see Camel Book, Page 85 { print "File is 7 days old\n"; }