Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: sorting a hash by value with ties

by Punitha (Priest)
on Jan 07, 2008 at 13:05 UTC ( #660820=note: print w/ replies, xml ) Need Help??


in reply to sorting a hash by value with ties

Hi craigt

Try this

print "$_:$hash{$_}\n" for (sort {$hash{$a} cmp $hash{$b}} keys %hash) +;

Punitha


Comment on Re: sorting a hash by value with ties
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2015-07-03 21:07 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 (56 votes), past polls