my $dir = '/path/to/dir'; print join ", ", grep { /(.*)\.mrg\z/ and not -f "$1.did" } <$dir/*\.mrg>'