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 (Chancellor)
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2016-06-28 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (350 votes). Check out past polls.