Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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
Domain Nodelet?
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: (11)
As of 2023-03-27 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (65 votes). Check out past polls.

    Notices?