Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: how to sort hash of array by value

by dwm042 (Priest)
on Oct 02, 2007 at 14:44 UTC ( [id://642120]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    ...
        $colorhash{$a}[1] <=> $colorhash{$b}[1] or 
        $colorhash{$a}[2] <=> $colorhash{$b}[2] 
    }
    
  2. or download this
    C:\Code>perl color-sort.pl
    Original order of data:
    ...
    
    Order, dark  is CCwhite,CCgrey,CCBlue,CCgray.
    Order, light is CCgray,CCBlue,CCgrey,CCwhite.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found