in reply to How to sort array by columns maintaining the rows? (for C style arrays)

Since these seem to be names, let me add a quick note about sorting on two (or more) columns.
@data = ( [qw(Bubba brutalski 20)], [qw(Bubba brutalski 10)], [qw(JoeBob brutalski 20)], [qw(Jethro brutalski 20)], [qw(Junior brutalski 20)], ); # Sorted by Name (Last, First) @ByName = sort {$a->[1] cmp $b->[1] || $a->[0] cmp $b->[0]} @data; # Sorted by Name, then score @FullSort = sort {$a->[1] cmp $b->[1] || $a->[0] cmp $b->[0] || $a->[2] <=> $b->[2]} @data;
The comparison operators return 0 when the operands are equal. So, using the || operator, we can sort first by Last Name, then First Name, then Score.

In the second example above, @FullSort looks like:

( [Bubba, brutalski, 10], [Bubba, brutalski, 20], [Jethro, brutalski, 20], [JoeBob, brutalski, 20], [Junior, brutalski, 20] )
because it is sorted by Last Name, then First Name, then Score.

Russ