Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
but What about to sort a multidimensional array using the elements of @{$array[1]}? Is that possible?@array = ([8,9,10], [4,5,6], [7,8,9]); @sorted = sort { $a->[1] <=> $b->[1] } @array
@unsortedarray = [8,9,10], [6,5,4], [7,8,9]; @sortedarray = [10,9,8], [4,5,6], [9,8,7];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorting multidimensional arrays
by ikegami (Patriarch) on Mar 15, 2005 at 19:33 UTC | |
|
Re: sorting multidimensional arrays
by friedo (Prior) on Mar 15, 2005 at 19:30 UTC | |
by Roy Johnson (Monsignor) on Mar 15, 2005 at 22:59 UTC | |
|
Re: sorting multidimensional arrays
by ikegami (Patriarch) on Mar 15, 2005 at 22:23 UTC | |
|
Re: sorting multidimensional arrays
by tlm (Prior) on Mar 16, 2005 at 02:56 UTC |