Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: how to put hash key and value in order

by Athanasius (Monsignor)
on Dec 20, 2012 at 02:56 UTC ( #1009675=note: print w/ replies, xml ) Need Help??

Comment on Re: how to put hash key and value in order
Re^2: how to put hash key and value in order
by LanX (Canon) on Dec 20, 2012 at 03:01 UTC
    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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-07-29 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls