in reply to Getting Keys of Hash from Values
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 Section
Seekers of Perl Wisdom