scottstef has asked for the wisdom of the Perl Monks concerning the following question:
#!/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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::mysql barfs
by Caillte (Friar) on May 21, 2001 at 02:32 UTC | |
|
Re: DBD::mysql barfs
by Caillte (Friar) on May 21, 2001 at 04:44 UTC | |
|
Re: DBD::mysql barfs
by olly (Scribe) on May 21, 2001 at 03:09 UTC | |
|
Re: DBD::mysql barfs
by andye (Curate) on May 21, 2001 at 17:27 UTC | |
|
Re: DBD::mysql barfs
by scottstef (Curate) on May 21, 2001 at 17:55 UTC |