![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re: Sorting an array using multiple values?by AR (Friar) |
on Sep 08, 2011 at 17:04 UTC ( #924876=note: print w/replies, xml ) | Need Help?? |
Firstly, what you have written won't work because you use "distance" in your data structure and "Distance" in your comparison. That being said, here you go: my @loop_sorted = sort { $b->{isPaidLink} <=> $a->{isPaidLink} || $a->{distance} <=> $b->{distance} } @test;
In Section
Seekers of Perl Wisdom
|
|