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

hm. you have to consider that with your code every line from the beginning of the file until /^MYTAG2/ will be skipped, instead of the text between /^MYTAG1/ and /^MYTAG2/

Replies are listed 'Best First'.
Re: Re: Fish
by Fletch (Bishop) on Apr 09, 2002 at 22:01 UTC

    Correct, but given the example data file it works. :)

    If the file doesn't start with MYTAG1, then you'd of course need to prefix with

    while( <> ) { last if /^MYTAG1/; print }

    Or use something like Re: How do I remove lines from a file....