my @l = ({FN => 'Les', LN => 'Howard'}, {FN => 'Larry', LN => 'Wall'}, {FN => 'Randal', LN => 'Schwartz'}); my @sorted = map { $_->[2] } sort { $a->[1] cmp $b->[1] || $a->[0] cmp $b->[0] } map { [$_->{FN}, $_->{LN}, $_] } @l; foreach (@sorted) { print "$_->{LN}, $_->{FN}\n"; }