Luke, the values you are sorting are the just filenames, so you must prefix the full path, like this:

my $path='/path/'; # important to use trailing slash
opendir( DIR, $path );
my @dots = grep(/recovery/,sort { -M $path.$a <=> -M $path.$b } readdir(DIR));
closedir(DIR);


When you ran it before, the current directory must have been set to /path for it to work.

John


Reply via email to