in reply to Re: how to check for a word in a file and if found remove that line, the above line and the below line from the file.
in thread how to check for a word in a file and if found remove that line, the above line and the below line from the file.

That fails if there are two lines in a row that matches.

That can fail if the last line matches. You can't rely on a file handle return EOF more than once.

  • Comment on Re^2: how to check for a word in a file and if found remove that line, the above line and the below line from the file.

Replies are listed 'Best First'.
Re^3: how to check for a word in a file and if found remove that line, the above line and the below line from the file.
by hdb (Monsignor) on Jan 22, 2016 at 19:16 UTC

    Damn! Life is just too complicated. Thanks for pointing this out.