in reply to Re: Hash search and returning by value
in thread Hash search and returning by value
use strict; use warnings; my $zip = '01234'; my %zips = ( "City One" => "04321", "City Two" => "01234", ); my ($zip_match) = grep { $_ eq $zip } values %zips; print "\n $zip_match\n"; # 01234
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hash search and returning by value
by LanX (Saint) on Dec 09, 2014 at 16:08 UTC | |
|
Re^3: Hash search and returning by value
by AnomalousMonk (Archbishop) on Dec 09, 2014 at 16:25 UTC |