in reply to Re^2: Delete old files
in thread Delete old files

How did you change the construction of the entries in @file_list after reading the second paragraph of readdir?

Also, why not use the following instead of the loop?

my @file_list= glob("$old/*");

Replies are listed 'Best First'.
Re^4: Delete old files
by Anonymous Monk on Mar 17, 2014 at 19:56 UTC
    Sure it can still be like that:
    ... # get all ttct files from here my @file_list= glob("old/*.txt"); for my $files (@file_list) { if ($now-(stat $files)[9] > $age) { # file older than 7 days print "$files\n"; } }

    Still doesnt work.

      Perhaps if you read the linked documentation you could see what's wrong.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.