Greetings all

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"


In reply to Configuring DynaLoader.pm by dooberwah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.