Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Hash value sorting

by moritz (Cardinal)
on Aug 14, 2012 at 13:29 UTC ( #987355=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Hash value sorting
in thread Hash value sorting

Then the following should work:

my %counts = %{ $self->{_counts} }; my @sorted_keys = sort { $counts{$a} <=> $counts{$b} } keys %counts;

And sort by counts (ascending).


Comment on Re^3: Hash value sorting
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2015-07-06 03:04 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 (69 votes), past polls