If you're going to do that often, and you can't have two cities with the same zip code, you can reverse the hash like this: my %reversed = reverse %zips; and then try exists $reversed{$zip}. Or you can grep on the values instead of the keys: grep { $_ eq $zip } values %zips;
In reply to Re: Hash search and returning by value
by Eily
in thread Hash search and returning by value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |