my @a = ([92,60], [6,5], [2,12]); my @sorted = sort { $a->[0] <=> $b->[0] } @a; # result: ([2,12], [6,5], [92,60])