in reply to complex hash sort

gamiensrule:

Assuming last_name is the column you want to sort on, you should be able to use:

my $clients = $get->fetchall_hashref('id'); my @list = keys %$clients; my @sorted_list = sort { $$clients{$a}{last_name} cmp $$clients{$b}{la +st_name} } @list;

Remember to replace cmp with <=> for numeric fields.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Update: After re-reading OP, I replaced SORT_KEY with last_name, to match his problem statement.