Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Sorting integer value hash keys

by JadeNB (Chaplain)
on Dec 25, 2009 at 18:53 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-28 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found