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