in reply to Re^4: best sort
in thread best sort
Well, sure. Here’s some of the code to generate one of those:If those were the things I was looking into, I would certainly not want a bare sort for any of them.If you anticipate repeated elements, you'd probably want a tie-breaking$a cmp $b
Look more reasonable?say $_->{PHRASE} for sort { $b->{TOTAL_VOWELS} <=> $a->{TOTAL_VOWELS} || $b->{MAX_ANY_VOWEL} <=> $a->{MAX_ANY_VOWEL} || $b->{NUM_OF_A} <=> $a->{NUM_OF_A} || $b->{NUM_OF_E} <=> $a->{NUM_OF_E} || $b->{NUM_OF_I} <=> $a->{NUM_OF_I} || $b->{NUM_OF_O} <=> $a->{NUM_OF_O} || $b->{NUM_OF_U} <=> $a->{NUM_OF_U} || $b->{NUM_OF_Y} <=> $a->{NUM_OF_Y} || $a->{DICTFOLD} cmp $b->{DICTFOLD}; || $a->{RECNO} <=> $b->{RECNO}; } @records;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: best sort
by jpl (Monk) on Aug 16, 2011 at 18:36 UTC |