in reply to How do I remove lines from a file...

The value returned from the scalar dot-dot operator is the line-number count of the hit, with "E0" appended on the closing line. So, just check for that:
while (<>) { print unless $count = /^MYTAG1/ .. /^MYTAG2/ and not $count =~ /E0/; }

-- Randal L. Schwartz, Perl hacker