Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by LanX (Bishop)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009678]
help
Chatterbox?
and one hand claps...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2017-12-16 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (447 votes). Check out past polls.

    Notices?