Help for this page
my @pairs; while (<$filehandle>) { # or whatever loop construct ... # sort array # NB: these are the special $a and $b, not yours @pairs = sort { $$a[0] <=> $$b[0] } @pairs;