sort { ## Compare through the shorter only for (0..(@$a>@$b ? $#{$b} : $#{$a})) { return $a->[$_] <=> $b->[$_] || next } ## If no difference, the longer array is first @$b <=> @$a;
In reply to Re^4: sort by a multiple columns
by Roy Johnson
in thread sort by a multiple columns
by johnnywang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |