CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [tc] Remove any amount of char from front and back of a string in a file: Edit Log



Chris Charley
User

Jun 7, 2018, 6:57 PM


Views: 2596
Re: [tc] Remove any amount of char from front and back of a string in a file

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.

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)


Edit Log:
Post edited by Chris Charley (User) on Jun 7, 2018, 8:14 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives