in reply to Do the Schwartzian boogy!

You don't need it! The ST works on the principle that you add the sort field, sort according to it, then remove it.

Your case is much simpler (assuming you want to create copies):

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @AoA = ( [ "n1", "34" ], [ "n3", "14" ], [ "n2", "1" ], [ "n4", "5" ], ); my @sorted = map { [ @$_ ] } sort { $a->[1] <=> $b->[1] } @AoA; print Dumper(\@sorted); __END__ $VAR1 = [ [ 'n2', 1 ], [ 'n4', 5 ], [ 'n3', 14 ], [ 'n1', 34 ] ];
Note that the map gets array references as $_, not pairs in @_.

Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

Don't fool yourself.