Hello,
I've got an array of arrays, and want to sort by the 3rd element of the
subarray. I then want to print out the sorted array, showing the index and
values. E.g.,
@AoA = (
[23.56, 65.2, 12.4],
[13, 56, 87],
[45,876, 23],
etc
)
And then the printout should look like:
1: 87
2: 23
3: 12.4
I've tried
@sorted = {$a ->[2] <=> $b ->[2]} @AoA but this gives a "cannot
modify.."error.
I've a feeling this is really trivial but have got abit bogged down with
it...
Thanks in advance
Richard
--
Dr Richard Adams
Chromosome Structure Group
University of Edinburgh
Kings Buildings,
Mayfield Rd,
Edinburgh
EH9 3JR UK
Email [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]