Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: sorting question

by redsquirrel (Hermit)
on Aug 01, 2002 at 15:10 UTC ( [id://186797]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://186797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found