No such thing as a small change | |
PerlMonks |
RE: RE: Re: Sorting on Section Numbersby jimt (Chaplain) |
on Jul 28, 2000 at 18:08 UTC ( [id://24849]=note: print w/replies, xml ) | Need Help?? |
There is a slight bug in this solution, it drops letters.
Using the above test data, the following list is generated: 1, 1.2, 2, 2.1.7, 2.2, 2.13, 3.4, 10.1, 10.1, 10.10 which dropped the letters from the section headings. Here's my version:
it works the same way, but I substituted in a Schwartzian transform to cache the original value of the heading instead of unpacking it again later. According to some tests with Benchmark, it's about 40% faster than doing the unpack later. Plus it keeps letters intact.
In Section
Seekers of Perl Wisdom
|
|