Zoogie has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm trying to write a sort function that sorts section numbers of a large document into the proper order. I keep having the feeling that's there's really easy way to do this in Perl that I'm missing :)
The section numbers look like "1, 2, 2.2, 2.13, 2.1.7, 3.4a, ...", etc. Neither a regular numeric sort nor a textual sort work, because "2.13" must come after "2.2", "10" must come after "2", and so forth.
I'm having a serious mental block on this one. Any ideas?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sorting on Section Numbers
by tye (Sage) on Jul 28, 2000 at 02:42 UTC | |
by chip (Curate) on Jul 28, 2000 at 14:54 UTC | |
by tye (Sage) on Jul 28, 2000 at 17:15 UTC | |
by chip (Curate) on Jul 28, 2000 at 22:34 UTC | |
by tye (Sage) on Jul 28, 2000 at 23:32 UTC | |
by jimt (Chaplain) on Jul 28, 2000 at 18:08 UTC | |
by DrManhattan (Chaplain) on Jul 28, 2000 at 18:37 UTC | |
by chip (Curate) on Jul 28, 2000 at 22:40 UTC | |
by turnstep (Parson) on Jul 28, 2000 at 21:27 UTC | |
Re: Sorting on Section Numbers
by athomason (Curate) on Jul 28, 2000 at 03:24 UTC | |
Re: Sorting on Section Numbers
by acme (Novice) on Jul 28, 2000 at 18:48 UTC | |
by tye (Sage) on Jul 28, 2000 at 18:59 UTC | |
Re: Sorting on Section Numbers
by ar0n (Priest) on Jul 28, 2000 at 02:21 UTC | |
Re: (turnstep) Sorting on Section Numbers
by turnstep (Parson) on Jul 28, 2000 at 22:05 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom