Create a reverse lookup hash. Consider:

use strict; use warnings; my %hash = (x => 1, y => 2, z => 3); my %rhash; @rhash{values %hash} = keys %hash; print $rhash{1};

Prints:

x

Perl is environmentally friendly - it saves trees

In reply to Re: getting hash key with value by GrandFather
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":