in reply to Sorting an array using multiple values?
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting an array using multiple values?
by ultranerds (Hermit) on Sep 08, 2011 at 17:55 UTC | |
by AnomalousMonk (Archbishop) on Sep 08, 2011 at 23:24 UTC |