[Memphis.pm] closer but still some things in wrong place (mysql.pm)

Brock Sides philarete at mindspring.com
Sun Mar 19 10:12:51 CST 2000



Durango wrote:

> [root at box1 gdchart]# ./mysqltest1.pl
> Can't locate mysql.pm in @INC (@INC contains:
> /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
> /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .)
> at ./mysqltest1.pl line 5.

[root at box1 gdchart]# locate mysql.pm
> /usr/lib/perl5/site_perl/DBD/mysql.pm

You have two separate problems:

(1) You should be calling the module as "use DBD::mysql" (so that perl
looks in the DBD subdirectories of the @INC directories).

(2) It's not going to find it anyway, because the DBD directory is not
in a subdirectory of @INC. It's in /usr/lib/perl5/site_perl, not /usr/lib/perl5/site_perl/5.005.

This is why you should either (a) stick with the perl and perl module
RPMs that come with your distro, or (b) build your own modules from
source. The RPMs are putting libs in a place perl doesn't expect to
look. 

You fix this by pushing onto @INC in your scripts, but who wants to do
that all the time?

Build the module yourself, and it will be put in the right place.

Brock
bsides at towery.com
philarete at mindspring.com
----------------------------------------------------------------------------
To unsubscribe, please send email to majordomo at pm.org
with 'unsubscribe memphis-pm-list' in the body of the message.
----------------------------------------------------------------------------




More information about the Memphis-pm mailing list