jesuashok has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

Let me brief the basics of hash.

keys %hash; will return the keys available in Hash.

values %hash; will return the values available in Hash.

But Recently I met an Issue as follows :-

my %param; foreach my $values ( sort values %user_details ) { $param{user_name} = $values; }

I will use the Above sorted user names to display in the web screen.

But suddenly I had a requirement like to get the keys of hash by using the hash values.

Is there a way to get the key of a hash using its values.

Because as per my understanding the keys of Hash can not be duplicate, Even if it is so there is no meaning in having that

$hash{1} = 'One'; $hash{1} = 'one'; # No use

can any one have Idea in getting this work ?

"Keep pouring your ideas"

2005-11-17 Retitled by Arunbear, as per consideration
Original title: 'Getting Keys of Hash'