in reply to how to sort multi-dimensional arrays
You can avoid this kind of error by just treating the arrays as ordered data structures:
I modified the index in the comparison to suit zero-base, and made the comparison operator numeric.my @x = ( [ 11, 12, 13], [ 21, 22, 23] ); my @sorted = sort { $b->[1] <=> $a->[1] } @x;
After Compline,
Zaxo
|
|---|