Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Perl 6 sorting (was: Re: Sort: By keys, values, and their returning values.)

by moritz (Cardinal)
on Nov 26, 2009 at 10:50 UTC ( #809530=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @sorted_keys = %hash.keys.sort
    
  2. or download this
    %hash.keys.sort({ %hash{$_} });
    
  3. or download this
    # return a random, anonymous hash:
    sub h {
    ...
    
    # and get the keys sorted numerically by value:
    my @keys = h().sort( { .value })>>.key
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://809530]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2018-02-20 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (274 votes). Check out past polls.

    Notices?