in reply to Reading a file and working only on certain lines

A bit more info would be helpful. Read How do I Post a Question Effectively

or

My version of the same

Your problem statement breaks down as follows from my perspective:


... and always remember to:
use strict; use warnings; etc...

Hope that is helpful...

...the majority is always wrong, and always the last to know about it...

Insanity: Doing the same thing over and over again and expecting different results...

A solution is nothing more than a clearly stated problem...otherwise, the problem is not a problem, it is simply an inconvenient fact