#!/usr/bin/perl -w use strict; use DBI; 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 +ay()) { print "Field1: $count\n Field2: $phrase\n Field3: $aut +hor\n Field4: $submitted_ by\n\n"; } $dbh->disconnect();
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?
In reply to DBD::mysql barfs by scottstef
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |