http://www.perlmonks.org?node_id=16511

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

My DBI script works correctly when run by a web server, but I get syntax errors when running it from the command line (Perl 5 and FreeBSD server). Here's the code:
use DBI; ($db) = DBI->connect('DBI:mysql:DatabaseName, $dbusername);
Here are the corresponding errors:
syntax error in file MyScript.cgi at line 66, next 2 tokens "use DBI" syntax error in file MyScript.cgi at line 82, next 2 tokens "->"
What's the problem?