Re: Sorting AofH over hash key(s)...



On Oct 30, 4:03 pm, nolo contendere <simon.c...@xxxxxxx> wrote:
On Oct 30, 4:40 pm, "/usr/ceo" <news...@xxxxxxx> wrote:

[Problem description snipped]

# from the Perl Cookbook

my @sorted =
sort { $a->name cmp $b->name
||
$b->age <=> $a->age } @employees;

Dad-gummit, I *looked* in the PC, and didn't see this... That syntax
makes perfect sense. It never occurred to me to extended the { sort
$a->{key} cmp $b->{key} } syntax into something broader with logical
operators. You get stuck in a rut with what you see as 90% used
sometimes.

NOW the solution is on the internet... :-)

Thanks!
/usr/ceo

.