my @matching_files = grep { $wanted{ $_ } } @files_in_dir;