in reply to Re^2: Perl and Mysql Queries
in thread Perl and Mysql Queries

At line 37 where you connect you have "Poster'. Perhaps that is just a typo in your post? If I run that code I get the same error as you posted which is caused by that incorrect quoting.
Bareword found where operator expected at /tmp/b.pl line 38, near "my$ +sth =$dbh->prepare("INSERT" (Might be a runaway multi-line "" string starting on line 37) Semicolon seems to be missing at /tmp/b.pl line 38. String found where operator expected at /tmp/b.pl line 39, near "print + "" (Missing semicolon on previous line?)

Replies are listed 'Best First'.
Re^4: Perl and Mysql Queries
by etj (Priest) on Jun 11, 2024 at 08:41 UTC
    That's going to be the problem. Generally, this sort of thing can be detected with e.g.:
    perl -cw filename.cgi
    Also, the OP desperately needs to start using git or similar SCM so they can see literally what changed between "it's working" and "it's not working".

      Git is very easy to install locally and would be helpful in tracking the problematic change(s). Git is also quite easy to extend to allow multiple participant. Once installed the basics are easy enough to pick up and there is an abundance of tutorials and guides. My own anecdote is that I found it tremendously useful for my latest Perl projects even before I started adding other people to the project. I did it early in the first one but realized that it would have been even better to use it from the start.