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;
In reply to Re^5: best sort
by tchrist
in thread best sort
by ag4ve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |