in reply to How to remove lines out of an ascii file

LINE: while (my $line = <INFILE>) { next LINE while ($line =~ /./ .. $line =~ /CPN/); # Once here, you have matched the first CPN line and onwards. }

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.