Jun 7, 2018, 6:57 PM
I hardly work with HTML and it seems you are doing so here. So I'm sorry, but I can't recommend a good parser.
Re: [tc] Remove any amount of char from front and back of a string in a file
Some things I noticed in your code.
print SUB if (/$find/); should be print SUB $_ if (/$find/);
chomp($_str1 = <MY_FILE>); should be chomp(my $_str1 = <MY_FILE>)
You open MY_FILE for reading and later try to (unsuccessfully) write to it print MY_FILE $back;
The errors you are getting are 'strict' telling you that $_str1 hasn't been declared with 'my'.
(This post was edited by Chris Charley on Jun 7, 2018, 8:14 PM)