for my $entry ( sort { $a->{town} cmp $b->{town} } @client ) { printf "%s\t%s\t%s\n", $entry->{town}, $entry->{surname}, $entry->{firstname}; }