Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Sorting integer value hash keys

by JadeNB (Chaplain)
on Dec 25, 2009 at 18:53 UTC ( #814364=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %statistics;
    undef @statistics{ 1..10 }; # or @statistics{ 1..10 } = (0) x 10
    say join "\n", sort { $a <=> $b } keys %statistics;
    
  2. or download this
    say join "\n", sort { $a <=> $b } keys %{{ map { $_ => 0 } 1..10 }}
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (1)
As of 2021-05-08 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (98 votes). Check out past polls.

    Notices?