I think you want something like this:
That iterates over all of the keys of %hash and if any value in the hash is equal to the value we're interested in, then the expression evaluates to a true value and so the key gets put into the @keys array.my @keys = grep { $hash{$_} eq $value } keys %hash;
In reply to Re: Getting Keys of Hash from Values
by duff
in thread Getting Keys of Hash from Values
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |