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


in reply to Getting Keys of Hash from Values

It's not clear from your description just what you want to try an achieve. Could you show us sample contents of %user_details and what you expect %param to contain following the loop?

As shown %param will contain one value (the "largest" according to the sort criteria) with the key user_name. I doubt that that is what you want.

Note also that the sort is futile in this case. It has no useful effect on the behaviour of the loop nor on how things are stored in %param.


DWIM is Perl's answer to Gödel