While I like your solution, FunkyMonk's routine could be made to sort on all elements of an array by changing its arguments:
my $sorted = FunkyMonkSort($unsorted, 0..$#$unsorted);
Your code meets the specification to sort a 2D array where each element in every row is compared.
FunkyMonk's code solves a different problem--sort a 2D array by an arbitrary subset of elements in each row.
I spent a while looking for the "bug". There really isn't a bug, it's just that you interpreting the spec differently than FunkyMonk did.
BTW, I like the way that you called attention the the fact the NetWallaSort() is a sort function, and gets $a and $b automagically.
TGI says moo
In reply to Re^5: How would I sort a two-dimensional array by multiple columns?
by TGI
in thread How would I sort a two-dimensional array by multiple columns?
by dbmathis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |