vonman has asked for the wisdom of the Perl Monks concerning the following question:
I would like to be able to continue to sort on count but then after count I would like to sort on type since I have many types and they may have the same count numbers. Any ideas? Thanks in advance!!foreach $junk (sort {$b->{'count'} cmp $a->{'count'}} @data) { print "$junk->{'count'} --> $junk->{'type'} --> $junk->{'a_point'} + --> $junk->{'z_point'} --> $junk->{'error'}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how do I sort on two fields in a hash table?
by lhoward (Vicar) on Mar 15, 2001 at 22:50 UTC | |
by dvergin (Monsignor) on Mar 15, 2001 at 22:58 UTC | |
by knobunc (Pilgrim) on Mar 16, 2001 at 00:14 UTC | |
by lhoward (Vicar) on Mar 16, 2001 at 01:43 UTC | |
by vonman (Acolyte) on Mar 16, 2001 at 00:50 UTC | |
by larryl (Monk) on Mar 16, 2001 at 01:16 UTC | |
by vonman (Acolyte) on Mar 16, 2001 at 00:51 UTC | |
by vonman (Acolyte) on Mar 15, 2001 at 22:51 UTC | |
|
Re: how do I sort on two fields in a hash table?
by a (Friar) on Mar 16, 2001 at 11:32 UTC |