<?xml version="1.0" encoding="windows-1252"?>
<node id="16511" title="DBI script works on command line but not in browser" created="2000-06-05 22:27:11" updated="2005-08-15 09:27:44">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
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:&lt;CODE&gt;
use DBI;
($db) = DBI-&gt;connect('DBI:mysql:DatabaseName, $dbusername);
&lt;/CODE&gt;
 
Here are the corresponding errors:&lt;CODE&gt;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 "-&gt;" 
&lt;/CODE&gt;
What's the problem?</field>
<field name="reputation">
1</field>
</data>
</node>
