I had some problems installing DBD::mysql, however it stated it installed clean. I am using the code from the tutorial stephen
wrote on mysql located here
. However when I run this code:
my $dbh = DBI->connect('DBI:mysql:quotes', 'scott', 'some_password')
or die "dumbass it didn't work: '$DBI::errstr'; stopped";
my $sth = $dbh->prepare(<<END_SQL) or die "Couldn't prepare statement:
+ $DBI:errstr; stopped";
SELECT count, phrase, author, submitted_by FROM qod WHERE coun
+t = `1`
END_SQL #This is Line 10
$sth->execute() or die "Couldn't make query: '$DBI:errstr'; stopped";
while ( my ($count, $phrase, $author, $submitted_by) = $sth->fetch_arr
print "Field1: $count\n Field2: $phrase\n Field3: $aut
+hor\n Field4: $submitted_
I get this error
Global symbol "$DBI" requires explicit package name at ./dbitest.pl line 10.
Global symbol "$DBI" requires explicit package name at ./dbitest.pl line 12.
Execution of ./dbitest.pl aborted due to compilation errors.
If I comment out use strict <nbsp&><nbsp&><nbsp&>I get a different goofy error:
/usr/libexec/ld.so: Undefined symbol "_mysql_init" called from perl:/usr/local/libdata/perl5/site_perl/i386-openbsd/auto/DBD/mysql/mysql.so at 0x401bc284
What am i doing wrong or do I need to reinstall the module?