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 reply to Re: Sorting an array using multiple values?
by AR
in thread Sorting an array using multiple values?
by ultranerds
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |