Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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?
[1nickt]: Discipulus I was sleeping in :-) It's a Holyday here. No work today. Just eating. Enjoy your day everymonk!

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-11-23 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (336 votes). Check out past polls.

    Notices?