I need to find all the files in a directory that havent been modified in the past 7 days. I've got my script to so far find the last modified time using the following:
I know it isn't pretty! How can I use the $age variable in order to delete the file if it hasn't been modified in 7 days?
Many thanks
Code:
use File::Find;
my $age;
@ARGV = qw(.) unless @ARGV; #Darllen o'r current directory os dim paramedr
find(\&nolFfeil, @ARGV);
sub nolFfeil {
$age = (stat($_))[9];
print "$age\n";
}
Many thanks