in reply to Re: Sorting Outline Numbers
in thread Sorting Outline Numbers

using Sort::Key it becomes even simpler (and faster?):
use Sort::Key qw(keysort); @sorted = keysort { join('', map chr, split /\./) } @data;

Replies are listed 'Best First'.
Re^3: Sorting Outline Numbers
by japhy (Canon) on Aug 11, 2005 at 14:19 UTC
    I'm assuming that's producing a Schwartzian Transform. The benefit of the Guttman-Rosler Transform (which I've employed) is that it uses 'sort' instead of 'sort { ... }'. However, speed really isn't an issue here (nor should it be).

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
      I'm assuming that's producing a Schwartzian Transform.

      No, Sort::Key is implemented in C so it doesn't have to use nasty tricks to avoid calling perl code inside the sorting algorithm. And it is faster than the GRT most of the times.