[Date Prev][Date Next][Thread Prev][Thread Next]
[Search]
[Date Index]
[Thread Index]
Re: [FWP] sorting text in human-order
- To: Piers Cawley <pdcawley@bofh.org.uk>
- Subject: Re: [FWP] sorting text in human-order
- From: Ian Phillipps <igp_list2@tesco.net>
- Date: Fri, 1 Dec 2000 09:53:53 +0000
- Cc: fwp@technofile.org
- Content-Disposition: inline
- Delivered-To: irons-bumppo:net-mpfwp@bumppo.net
- In-Reply-To: <m2g0k91x17.fsf@rt158.private.realtime.co.uk>; from "Piers Cawley" on 30 Nov 2000 at 12:09:40
- References: <84KJ6gzkg+rQ092yn@efn.org> <m2y9y2258z.fsf@rt158.private.realtime.co.uk> <87TJ6gzkgeSB092yn@efn.org> <m2lmu1252h.fsf@rt158.private.realtime.co.uk> <20001130112635.A3450@homer.diplex.co.uk> <m2g0k91x17.fsf@rt158.private.realtime.co.uk>
On Thu, 30 Nov 2000 at 12:09:40 +0000, Piers Cawley wrote:
> Ian Phillipps <igp_list2@tesco.net> writes:
> > s/\d+/ "\01".pack 'w',$& /ge
> > where the "\01" serves to place the numbers before the sort; put in a
> > big character to sort later.
> I have the distinct recollection that BER numbers didn't sort
> correctly under ASCII. However, I may be completely and utterly mad.
The sanity is yours. As part of my road back to the light, here's an
idea which (if I'm right this time) sorts all numbers up to 10E10-1
correctly:
s/\d+/ length($&).$& /eg
Ian
==== Want to unsubscribe from Fun With Perl? Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
==== unsubscribe