home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!usc!sdd.hp.com!saimiri.primate.wisc.edu!ames!sun-barr!sh.wide!wnoc-tyo-news!sranha!sranhd!sran230!utashiro
- From: utashiro@sran230.sra.co.jp (Kazumasa Utashiro)
- Subject: Re: Looking for a "numerical/alpha" sort routine.
- References: <1992Dec23.193120.25893@pool.info.sunyit.edu> <Bzqunp.9rD@sran230.sra.co.jp> <1992Dec24.125700.6133@cs.ruu.nl>
- Organization: Software Research Associates, Inc., Japan
- Date: Fri, 25 Dec 1992 01:51:52 GMT
- Message-ID: <BzsL6H.n7@sran230.sra.co.jp>
- Lines: 14
-
- In article <1992Dec24.125700.6133@cs.ruu.nl>
- piet@cs.ruu.nl (Piet van Oostrum) writes:
- >> KU> Next line works for your example.
- >>
- >> KU> @s = sort { $a <=> $b || $a cmp $b } ('3c', '1', '3a', '2', '3b');
- >> KU> print "@s\n";
- >>
- >> This fails however in the presence of leading zeroes in the mixed keys:
-
- That is why I wrote "your example".
-
- Don't say { $a cmp $b } is enough for his example :-)
-
- --utashiro
-