dooberwah has asked for the wisdom of the Perl Monks concerning the following question:
I think that I have to mention that this is my 42nd post. Let's all bow our heads and take a moment to remember Douglas Adams.
The problem:
I'm trying to learn how to interact with the MySQL database using perl. After following some of the tutorials in this very monastary I came up with this code:
#!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect('DBI:mysql:DB_NAME', 'USERNAME', 'PASSWORD') or die "Couldn't open database: $DBI::errstr; stopped"; my $sth = $dbh->prepare("SELECT date, time, title, text FROM thoughts +WHERE id = 3") or die "Couldn't prepare statment: $DBI::errstr; stopped"; $sth->execute() or die "Couldn't execute statement: $DBI::errstr; stop +ped"; while ( my ($date, $time, $title, $text) = $sth->fetchrow_array() ) { print STDOUT "date: $date time: $time\ntitle: $title\ntext:\n$text +"; } dbh->disconnect();
When I try to run this script I get these errors:
dooberwah@kyle:~$ perl perl/dbi.pl Can't load '/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DBI/D +BI.so' for module DBI: libgcc_s.so.1: cannot open shared object file: + No such file or directory at /usr/local/lib/perl5/5.6.1/i686-linux/D +ynaLoader.pm line 206. at /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/DBI.pm line 189 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/i686-linux/DBI.pm line 189. Compilation failed in require at perl/dbi.pl line 6. BEGIN failed--compilation aborted at perl/dbi.pl line 6. dooberwah@kyle:~$
As I looked at this for the first time I thought, "Hmmmm ... this DynaLoader thing is having some sort of problem. I better recompile it." After a quick search of CPAN I find that it comes bundled with Perl, and that I can't just re-download it from CPAN.
I'm not even sure about what to do in this situation. Just recompiling Perl seems like a cheap way to get around the problem, and I wouldn't ever find out what the real trouble was (if it actually did fix the problem worked). I was wondering if anybody knows how I can re-configure DynaLoader, and if that would actually help.
-Ben Jacobs (dooberwah)
http://dooberwah.perlmonk.org
"one thing i can tell you is you got to be free"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Configuring DynaLoader.pm
by Masem (Monsignor) on Jan 15, 2002 at 04:26 UTC | |
|
Re: Configuring DynaLoader.pm
by Ineffectual (Scribe) on Jan 15, 2002 at 04:41 UTC | |
|
Re: Configuring DynaLoader.pm
by davis (Vicar) on Jan 15, 2002 at 17:03 UTC |