http://qs321.pair.com?node_id=1062164


in reply to Sort over remaining part of array

Sorting with respect to the first column is a bit more involved compared to your code, see below. Sorting only part of the array can be achieved using array slices:

@AoA = ( [ 0.5, "b1", "c0" ], [ 0.4, "b1", "c1" ], [ 0.7, "b2", "c2" ], [ 0.3, "b3", "c3" ], [ 0.6, "b3", "c4" ], ); @AoA[2..$#AoA] = sort { $a->[0] <=> $b->[0] } @AoA[2..$#AoA]; print Dumper \@AoA;