Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!apple!oliveb!orc!mipos3!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Arrgh! Bugs!! (was Re: sort) Keywords: sort Message-ID: <1990Feb1.172044.10859@iwarp.intel.com> Date: 1 Feb 90 17:20:44 GMT References: <1990Feb1.050145.21183@athena.mit.edu> <1990Feb1.163539.10576@iwarp.intel.com> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Distribution: usa Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 26 In-Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) In article <1990Feb1.163539.10576@iwarp.intel.com>, I said: | sub byfield14to20 { substr($a, 13, 7) > substr($b, 13, 7); } Acck! Make that: sub byfield14to20 { substr($a,13,7) < substr($b,13,7) ? -1 : 1; } and likewise: | sub byfourthfield { $f4[$a] > $f4[$b]; } sub byfourthfield { $f4[$a] < $f4[$b] ? -1 : 1; } Accck pthptpth! That'll teach me to write code this early in the morning! Special thanks to Bart Schaefer for reading his news as quick as it comes in, and sending me a nice nastygram pointing out the error of my ways. I am so ashamed. :-) Just another (former) Perl hacker, :-) -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/