Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 rifling through the Monastery: (5)
As of 2017-01-20 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.