in reply to Re: Parsing file and removing a sectionin thread Parsing file and removing a section
$flag =1 if /pattern/; print NEW $lastln unless $flag; $lastln = $_; if ($flag and /end_pattern/) { $lastln = ''; $flag = 0; } [download]