Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: problem sorting by non-consecutive fields

by borisz (Canon)
on Apr 07, 2004 at 20:39 UTC ( [id://343426]=note: print w/replies, xml ) Need Help??


in reply to problem sorting by non-consecutive fields

#!/usr/bin/perl while (<DATA>) { push @array, [ split ' ' ]; } @array = sort { $a->[2] cmp $b->[2] or $a->[0] <=> $b->[0] } @array; for ( @array ) { print join(' ', @$_), "\n"; } __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
Boris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2024-04-18 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found