jeorgen has asked for the wisdom of the Perl Monks concerning the following question:
I'm installing perl modules at a customer's web account, where we do not have root access. So I have created a local perl library, "/home/customer/customers_perl_modules".
I install modules with CPAN configured for the local library, and sometimes with perl Makefile.PL PREFIX =/home/customer/customers_perl_modules
The info on the local libray is stored in the myconfig.pm in the .cpan directory in the user's home directory.
Now, all the modules installed do indeed end up inside the "/home/customer/customers_perl_modules"directory, but often not directly under it, but deeper, in directories named after the version of perl that is used, the processor architecture, under the library "site_perl". There is:
lib/site_perl, lib/site_perl/5.005/, lib/site_perl/5.005/i386-linux/
Now, writing
use lib "/home/customer/customers_perl_modules";
doesn't work for the below script, I seem to need the two following "use libs" in the script for it to work:
It seems kind of counter-productive to manually specify the path to each architecture-specific and version-specific directory. I would have thought that this would be handled automatically either by perl itself or by the lib pragma.use lib "/home/customer/customers_perl_modules/lib"; use lib "/home/customer/customers_perl_modules/lib/site_perl/5.005/i38 +6-linux/"; use lib "/home/customer/customers_perl_modules/lib/site_perl/5.005/"; use XML::Parser; use Data::DumpXML; print "Hi\n";
So should I:
a) Use some other way than PREFIX and .cpan/myconfig.pm to tell the modules where to be
b) Manually move the modules up and out of the architecture and version-specific libraries
c) use something else than use lib
d) subclass lib module and auto-create appended paths with version, "site_perl" and architecture values added
e) or is my perl broken
? "perl -V" gives this:
Am I missing something?Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=linux, osvers=2.2.5-22smp, archname=i386-linux uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2 0 +9:11:51 edt 1999 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2 -m486 -fno-strength-reduce', gccversion=egc +s-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' stdchar='char', d_stdstdio=undef, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lc -lposix -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynami +c' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Built under linux Compiled at Aug 10 2000 15:33:00 @INC: /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
/jeorgen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "use lib" whith architecture and version specific dirs
by Fastolfe (Vicar) on Dec 11, 2000 at 07:27 UTC | |
|
Re: "use lib" whith architecture and version specific dirs
by jeorgen (Pilgrim) on Dec 11, 2000 at 07:46 UTC | |
by chipmunk (Parson) on Dec 11, 2000 at 08:29 UTC | |
by Fastolfe (Vicar) on Dec 11, 2000 at 08:03 UTC | |
|
Re: "use lib" whith architecture and version specific dirs
by FouRPlaY (Monk) on Dec 12, 2000 at 01:17 UTC |