The line
print FH
does not make sense. Did you mean
print FH $_;
UPDATE: A pair of {} is missing after the "if" line as well. print FH $; does not make sense either.
Can you make the script work in your sense, and re-post to make sure I can look at the right one? It is a bit difficult to guess what the issue is...
CORRECTION: It seems to create your desired output now...
In reply to Re: Search and add lines into a file. Getting bareword error.
by hdb
in thread Search and add lines into a file. Getting bareword error.
by freekngeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |