Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Perl sort

by Corion (Patriarch)
on Apr 26, 2016 at 14:30 UTC ( [id://1161559]=note: print w/replies, xml ) Need Help??


in reply to Perl sort

You are calling sort twice, which makes little sense. Also, your code does not even compile.

Most likely you wanted something like:

my @sorted = map {$_->[0]} sort { $a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] } map {chomp;[$_,split(/\t/)]} <FILE>; print OUT "$_\n" for @sorted;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-23 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found