Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: how to sort hash of array by value

by blkperl (Initiate)
on Oct 01, 2007 at 22:51 UTC ( [id://642017]=note: print w/replies, xml ) Need Help??


in reply to Re: how to sort hash of array by value
in thread how to sort hash of array by value

oops, but it still does not change the order based on the value. There is not change in the hash order.

Replies are listed 'Best First'.
Re^3: how to sort hash of array by value
by FunkyMonk (Chancellor) on Oct 01, 2007 at 23:23 UTC
    The hash order is always random, and has nothing to do with the order in which that hash was created.

    Compare the following snippet with the original:

    use Data::Dumper; my %colorhash = ( CCgray => [ "0","0","0" ], CCwhite => [ "1","0","0" ], CCgrey => [ "0","2","0" ], CCBlue => [ "0","0","3", ] ); my @light2dark = keys %colorhash; print Dumper \@light2dark;

    PS Have you enclosed your original program within <code>...</code> tags yet?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found