Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: how to put hash key and value in order

by LanX (Canon)
on Dec 20, 2012 at 03:01 UTC ( #1009678=note: print w/ replies, xml ) Need Help??


in reply to Re: how to put hash key and value in order
in thread how to put hash key and value in order

Have to say, this solution

      my @keys = sort { $hash{$a} <=> $hash{$b} } keys %hash;

is better than mine, cause it tolerates duplicated values! :)

Cheers Rolf


Comment on Re^2: how to put hash key and value in order
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009678]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-07-30 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls