Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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.

by ikegami (Patriarch)
on Jan 22, 2016 at 16:27 UTC ( [id://1153382]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1153382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-18 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found