Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: sorting hash by a certain value (that it is in an array)

by clueless newbie (Chaplain)
on Jul 17, 2012 at 16:06 UTC ( #982273=note: print w/replies, xml ) Need Help??


in reply to Re^2: sorting hash by a certain value (that it is in an array)
in thread sorting hash by a certain value (that it is in an array)

Perhaps you could use Tie::IxHash?
my %unordered=(...); tie my %ordered, "Tie::IxHash"; for my $key (sort {$unordered{$a}[1] cmp $unordered{$b}[1]} keys %$ +unordered) { $ordered{$key}=$unordered->{$key}; };

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982273]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2016-12-03 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (52 votes). Check out past polls.