Given the constraint that the values are distinct, just make a reverse mapping and use that. my %vals_to_keys; @vals_to_keys{ values %src } = keys %src;

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re: getting hash key with value by Fletch
in thread getting hash key with value by sovixi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":