in reply to How to sort in perl on the basis of one field.
Then sort the AoA according to the second element. For a numerical sort, something like this (also untested):my @AoA = [split /[,\s]+/, $_] for @array;
Then you can join the elements of the inner arrays using join or map, I'll leave it to you (you don't give enough details). The whole thing could be done in one single pipeline step, but since you appear to be a beginner, it is probably better to make in in 3 steps as explained above.@AoA = sort { $b->[1] <=> $a->[1] } @AoH;
|
|---|