Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^6: best sort

by jpl (Monk)
on Aug 16, 2011 at 18:36 UTC ( #920541=note: print w/ replies, xml ) Need Help??


in reply to Re^5: best sort
in thread best sort

It helps a lot with the how I am comparing part, although if anyone guessed in advance that was how By vowels: sorted, I'd like to solicit their advice on the outcome of upcoming NFL games. It's still not exactly what I had in mind for bringing all identical terms together. The

$a->{RECNO} <=> $b->{RECNO}
is unnecessary if the sort is stable, as sort() is, by default. Since different words can compare equal under the influence of
$a->{DICTFOLD} cmp $b->{DICTFOLD}
(if I'm correctly guessing what DICTFOLD is), I still might see
word Word word Word
in the sorted output, when I might have preferred
word word Word Word
which makes it easier to determine if words are "unique" without repeating all the complicated logic. So I would prefer
$a->{ORIGINAL} cmp $b->{ORIGINAL}
as the final tie-breaker. That's neither better nor worse than your code, merely different.


Comment on Re^6: best sort
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://920541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-09-16 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (51 votes), past polls