Re: Sorting AofH over hash key(s)...
- From: "/usr/ceo" <newsbot@xxxxxxx>
- Date: Tue, 30 Oct 2007 21:16:10 -0000
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
.
- Follow-Ups:
- Re: Sorting AofH over hash key(s)...
- From: Tad McClellan
- Re: Sorting AofH over hash key(s)...
- References:
- Sorting AofH over hash key(s)...
- From: /usr/ceo
- Re: Sorting AofH over hash key(s)...
- From: nolo contendere
- Sorting AofH over hash key(s)...
- Prev by Date: Re: Sorting AofH over hash key(s)...
- Next by Date: Re: How to convert timestamp to epoch?
- Previous by thread: Re: Sorting AofH over hash key(s)...
- Next by thread: Re: Sorting AofH over hash key(s)...
- Index(es):