Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Sorting integer value hash keys

by ikegami (Pope)
on Dec 25, 2009 at 19:25 UTC ( #814365=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    say join "\n", sort { $a <=> $b } keys %{{ map { $_ => 0 } 1..10 }}
    
  2. or download this
    say for sort { $a <=> $b } keys %{{ map { $_ => 0 } 1..10 }}
    
  3. or download this
    say for sort { $a <=> $b } 1..10;
    
  4. or download this
    say for sort { $a <=> $b } map "$_", 1..10;
    

Log In?
Username:
Password:

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

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





    Results (99 votes). Check out past polls.

    Notices?