in reply to getting hash key with value

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