Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Twice the pleasure of sorting a hash

by halley (Prior)
on Apr 26, 2004 at 13:52 UTC ( [id://348178]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ...
        sort {  $h{$b} <=> $h{$a}  ||  $a cmp $b  }
        keys %saved_key;
    
  2. or download this
    my @sorted = 
        sort {          $hash{$b}  <=>  $hash{$a}          ||
    ...
                         func($a)  <=>  func($b)           ||
                 $other{name}{$b}  cmp  $other{name}{$a}    }
        @unsorted;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-07-19 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.