home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / perl / 7612 < prev    next >
Encoding:
Text File  |  1992-12-24  |  944 b   |  25 lines

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