Which is why globing can be so lovely, as it includes the file path for you :) I'm not sure if this is any faster than Abigail-II's solution. At least this does only check for the existence of each file once rather than two checks.
my $dir = '/path/to/dir'; print join ", ", grep { /(.*)\.mrg\z/ and not -f "$1.did" } <$dir/*\.mrg>'
In reply to Re^3: Finding un-paired files in a directory
by Coruscate
in thread Finding un-paired files in a directory
by inman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |