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

Re^3: find reverse complement of every 2nd line

by syphilis (Chancellor)
on Jul 09, 2013 at 23:40 UTC ( #1043396=note: print w/replies, xml ) Need Help??


in reply to Re^2: find reverse complement of every 2nd line
in thread find reverse complement of every 2nd line

my problem actually is doing this only to every other line and not the entire file

The special variable $. (documented in perldoc perlvar) keeps count of the line numbers, so you can do something like:
while(<IN>) { next if $. % 2; # skip odd lines # do the processing }
Cheers,
Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043396]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2016-12-11 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (168 votes). Check out past polls.