Better referred to as elements 0 and 1, you can sort as you want with the or operator. <=> is for numeric comparison, cmp for strings. If @data contains your AoA,
my @sorted_data = sort { $a->[0] <=> $b->[0] or $a->[1] cmp $b->[1] } @data;
After Compline,
Zaxo
In reply to Re: 2 dimensional array sorting...
by Zaxo
in thread 2 dimensional array sorting...
by Soko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |