in reply to find reverse complement of every 2nd line

This was discussed on SoPW recently. Here's one solution (mine! what a coincidence): Re: Reverse Complement.

And a link to the entire thread: Reverse Complement.

To process every other line, just check the input line number with $. when you read your file in a while loop, something like this:

while (<DATA>) { chomp; for ($_) { say scalar reverse when $. == 4; say uc scalar reverse when $. % 2 == 0; default { say }; } }

(Note the above does not calculate the reverse compliment; check the provided links for that. This is just meant to show you a straightforward way to process the lines you desire.)

With a little adaptation, you should have no problem coming up with a solution to your problem.