http://qs1969.pair.com?node_id=509195


in reply to Getting Keys of Hash from Values

I think you want something like this:

my @keys = grep { $hash{$_} eq $value } keys %hash;
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.