scottmf
2005-07-20 23:13:55 UTC
I have an array similar to the following (the one I am actually sorting
has 25 columns and several thousand rows):
@AoA = ([3, 1, 8],
[2, 2, 6],
[2, 1, 4],
[3, 2, 3]);
and I need to sort it by the second column, then the first column so
that my output would be as follows:
@sorted = ([2, 1, 4],
[3, 1, 8],
[2, 2, 3],
[3, 2, 6]);
I can sort by one column without a problem but have not been able to
find anything on sorting with respect to both columns. Any help would
be much appreciated.
has 25 columns and several thousand rows):
@AoA = ([3, 1, 8],
[2, 2, 6],
[2, 1, 4],
[3, 2, 3]);
and I need to sort it by the second column, then the first column so
that my output would be as follows:
@sorted = ([2, 1, 4],
[3, 1, 8],
[2, 2, 3],
[3, 2, 6]);
I can sort by one column without a problem but have not been able to
find anything on sorting with respect to both columns. Any help would
be much appreciated.