Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 chanting in the Monastery: (3)
As of 2024-04-25 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found