in reply to Using -M to test age of file
This is just a guess, but... Are you either pre-pending the directory name to the file name, or changing to the directory? The symptom sounds like you're doing something like:
When what you should be doing is:foreach my $dir (@directories) { foreach my $file (@filenames) { $age = -M $file; ....
or something like this:foreach my $dir (@directories) { foreach my $file (@filenames) { $age = -M "$dir/$file"; # see the difference? ....
foreach my $dir (@directories) { chdir $dir or die "Couldn't chdir to $dir: $!\n"; foreach my $file (@filenames) { $age = -M $file; .... } chdir ".." or die "Help, I stranded myself";
As I said, just a guess. HTH.
|
|---|