http://qs1969.pair.com?node_id=436421


in reply to To Pattern Match or not to Pattern Match

I'd make a hash out of @cdvw_list, and parse the id out of every name, and base my test on whether the id exists in the list:

my %cdwv_hash; @cdwv_hash{@cdwv_list} = (1) x @cdwv_list; for (@names) { my ($id, $name) = (m{^([^/]+)/([^|]+)|}); if (exists $cdwv_hash{$id}) { print "$id: $name\n"; } else { print "No match for $_ in cdwv_list\n" } }