in reply to Accessing keys through values
If not, you'll have to iterate over the hash.%h = (a=>"A", "b"=>"B"); %h2 = reverse %h; print $h2{A}; #a
oh ... and please use code-tags.%h = (a=>"A", "b"=>"B", "bb" => "B"); for ( keys %h ) { print $_ if $h{$_} eq "B"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Accessing keys through values
by cybersmithuk (Initiate) on Apr 26, 2005 at 10:52 UTC |