Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 lurking in the Monastery: (2)
As of 2015-07-05 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls