in reply to Re: Advanced Sorting
in thread Advanced Sorting

Thanks for the reply, but that's not quite what I need. I need to sort on values that may be all strings OR all numbers, not a primary then secondary search. And one small optimization to your code would be:
@sorted = sort { <BR> $a->{'name'} cmp $b->{'name'} || $a->{age} <=> $b->{age} <BR> } @data; <BR>
Perl's sorting algorithm will return '0' if the "cmp" is equal, defaulting to the secondary sort.