Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Reading two files, cmp certain cols

by mscharrer (Hermit)
on Sep 19, 2008 at 09:02 UTC ( [id://712480]=note: print w/replies, xml ) Need Help??


in reply to Reading two files, cmp certain cols

Hi, could you please use <readmore> tags for code of this length. Also consider to use perltidy to format your code.

The previous poster already gave you a fix, so I just want to give you a little advice:
Your construct:

if ($current_line[0] eq $key) { if ($current_line[1] == $position1) { if ($current_line[2] ==1) { if ($current_line[3] >= 3) { print join ("\t", $current_line[0],$current_line[1],$current +_line[2],$current_line[3], "***",$key, $position1), "\n"; } } } }
is much tidier written this way:
if ( $current_line[0] eq $key && $current_line[1] == $position1 && $current_line[2] == 1 && $current_line[3] >= 3) { print join ("\t", @current_line[0..3], "***", $key, $position1), " +\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-19 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found