Dear fellow monks

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:

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";
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.

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:

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
Am I missing something?

/jeorgen


In reply to "use lib" whith architecture and version specific dirs by jeorgen

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.