for my $record (@sorted) { print @$record; } # OR for your other request print $sorted[0][2], $sorted[2][1];