in reply to Re: Parsing file and removing a section
in thread Parsing file and removing a section

Looks like brendonc needs to see if the _next_ line matches. So maybe
$flag =1 if /pattern/; print NEW $lastln unless $flag; $lastln = $_; if ($flag and /end_pattern/) { $lastln = ''; $flag = 0; }
?

p