home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!mcsun!sun4nl!ruuinf!piet
- From: piet@cs.ruu.nl (Piet van Oostrum)
- Subject: Re: Looking for a "numerical/alpha" sort routine.
- Sender: network-news@cs.ruu.nl
- Message-ID: <1992Dec24.125700.6133@cs.ruu.nl>
- In-Reply-To: utashiro@sran230.sra.co.jp (Kazumasa Utashiro)
- Date: Thu, 24 Dec 1992 12:57:00 GMT
- Reply-To: piet@cs.ruu.nl (Piet van Oostrum)
- References: <1992Dec23.193120.25893@pool.info.sunyit.edu> <Bzqunp.9rD@sran230.sra.co.jp>
- Organization: Dept of Computer Science, Utrecht University, The Netherlands
- Lines: 13
-
- >>>>> utashiro@sran230.sra.co.jp (Kazumasa Utashiro) (KU) 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:
-
- @s = sort { $a <=> $b || $a cmp $b } ('3c', '1', '3a', '2', '03b');
- print "@s\n";
- --
- Piet van Oostrum <piet@cs.ruu.nl>
-