PERL5LIB - @INC - machine dependant subdirs

K

Koos Pol

Hello all,

Is there a common way to construe the machine/architecture
dependent subdirectries below a lib dir and have them added to
@INC?


Background:
I want to keep a local DBI and DBD with my application. When
building the Msql-Mysql-modules it says:

"Using DBI 1.32 installed
in /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/DBI"

This message in spewed
by /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/DBI/DBD.pm
Now to find modules DBD simply greps @INC (which only includes my
local lib dir /home/koos/my_perl_app/lib (set by PERL5LIB) and
not the machine dependent subdirs below it. Therefor it doesn't
see my local DBI installed in the machine dependent subdirs
below /home/koos/my_perl_app/lib

Is there any way to construe and add these machine dependent
subdirs to @INC without hacking the DBD code?

Thanks,
Koos
 
B

Brian McCauley

Koos said:
Is there a common way to construe the machine/architecture
dependent subdirectries below a lib dir and have them added to
@INC?

Yes. Use a sub-directory that matches the archname.
Background:
I want to keep a local DBI and DBD with my application. When
building the Msql-Mysql-modules it says:

"Using DBI 1.32 installed
in /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/DBI"

This message in spewed
by /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/DBI/DBD.pm
Now to find modules DBD simply greps @INC (which only includes my
local lib dir /home/koos/my_perl_app/lib (set by PERL5LIB) and
not the machine dependent subdirs below it.

Hmmm... it works OK for me in 5.6.1 and 5.8.0 on Linux.

Can I just confirm - you are saying that:

PERL5LIB=/home/koos/my_perl_app/lib

And there is at least one of the directories:

/home/koos/my_perl_app/lib/5.8.0/i586-linux-thread-multi
/home/koos/my_perl_app/lib/i586-linux-thread-multi

And you are running perl 5.8.0

But that those directories do not appear in @INC?

One thing I have noticed on my rather buggered-about-with install of
5.8.0 is that the achitecture name in the /usr/lib/perl5/site_perl/5.8.0
hierachy is in fact not the true archname as reported by perl -v.

Check that perl -v reports i586-linux-thread-multi as the architecture.

BTW: You really should be using a later 5.8.x!
 
K

Koos Pol

Brian McCauley wrote (Wednesday 01 September 2004 19:20):
Can I just confirm - you are saying that:

PERL5LIB=/home/koos/my_perl_app/lib

And there is at least one of the directories:

/home/koos/my_perl_app/lib/5.8.0/i586-linux-thread-multi
/home/koos/my_perl_app/lib/i586-linux-thread-multi

And you are running perl 5.8.0

But that those directories do not appear in @INC?


By asking the right questions you had me find the solution:

I haven't got
/home/koos/my_perl_app/lib/5.8.0/i586-linux-thread-multi
/home/koos/my_perl_app/lib/i586-linux-thread-multi
but
/home/koos/my_perl_app/lib/perl5/5.8.0/i586-linux-thread-multi
/home/koos/my_perl_app/lib/perl5/i586-linux-thread-multi
^^^^^

Note how 'perl5' sits there in between.
Using PERL5LIB=/home/koos/my_perl_app/lib/perl5 the machine
dependant directories are added to @INC :)

Funny though that this demonstrates a discrepancy between PREFIX
and PERL5LIB. Can't remember that I had to pull these tricks in
the 5.004 generation.

Thanks for helping me out :)
Koos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top