Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Sort multivalued hash by value in array reference

by knobunc (Pilgrim)
on Feb 27, 2002 at 18:25 UTC ( #147992=note: print w/ replies, xml ) Need Help??


in reply to Sort multivalued hash by value in array reference

use strict; ... foreach my $user (sort { $user_hash{$a}[0] <=> $user_hash{$b}[0] } keys %user_hash) { my ($age, $height, $weight) = @{ $user_hash{$user} }; print "User $user (age $age, height $height, weight $weight)\n"; }

-ben


Comment on Re: Sort multivalued hash by value in array reference
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-07-13 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (246 votes), past polls