in reply to How to Know how much old my file is

#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; for my $file ( path('.')->children ){ my $days = -M $file; if( $days > 7 ){ print qq{rm "$file" :: $days\n}; } } __END__