in reply to sorting question

my @list = qw(nfs-4 afp-2 cifs-8 nfs-2 cifs-1 afp-7 cifs-11); print sort fooSort @list; sub fooSort { my @a = split '-', $a; my @b = split '-', $b; $a[0] cmp $b[0] || $a[1] <=> $b[1] }
--Dave

update: I like Abigail-II's Schwartzian Guttman-Rosler Transform! ++!

Replies are listed 'Best First'.
Re: sorting question
by Abigail-II (Bishop) on Aug 01, 2002 at 15:24 UTC
    What Schwartzian Transform? I made use of a technique known as the "Guttman-Rosler Transform".

    Abigail