Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: problem sorting by non-consecutive fields

by ccn (Vicar)
on Apr 07, 2004 at 20:40 UTC ( [id://343428]=note: print w/replies, xml ) Need Help??


in reply to problem sorting by non-consecutive fields

print map { ${ $_->[2] } } sort { $a->[0] cmp $b->[0] or $a->[1] <=> $b->[1] } map { [ ( split('\s+', $_, 3) )[2, 0], \$_ ] } <DATA>; __DATA__ 7 modify ldfapg pub abc.h 8 modify bfxml dtd/src newfiles.ksh 9 delete bfxml dtd/src newfiles.ksh 10 modify bfxml dtd/src newfiles.ksh

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-28 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found