[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] sorting text in human-order



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