BRIEF:

Why do Perl and CPAN use so many different install directories?

install/lib, install/lib/perl5, and install/lib/site_perl

PERL version specific

etc.

DETAIL:

I install a lot of stuff from CPAN. Because I do not have root, I usually install it in ~/.cpan/install - i.e. I have passed ~/.cpan/install as --install_base to various tools.

I understand that I have to put stuff from the install path into PERL5LIB. I also understand that there are some macine specific components, like *.so, and Perl version specific components.

But: why are there so many blamed directories where stuff gets put?

Here is a highly edited directory tree:

machine-name /users/glew/.cpan/ 52 : dtree install install " bin " lib " " 5.10.0 ... lots of modules " " " x86_64-linux ... arch dependent stuff ... lots of modules " " " " auto ... lots of modules " " " " " B " " " " " " Lint " " " " B " " " " " Lint ... Q: wy is B::Lint in both .../li +b/5.10/0/x86_64-linux/B::Lint, and in auto? " " 5.8.5 ... lots of modules " " " x86_64-linux ... lots of modules " " " " auto ... lots of modules " " perl5 " " " 5.8.3 ... lots of modules " " " " x86_64-linux-thread-multi " " " " " auto ... lots of modules " " " File " " " " 5.8.3 " " " x86_64-linux " " site_perl ... lots of modules, but I'm tired of saying this " " " 5.10.0 " " " " x86_64-linux " " " " " auto " " " 5.8.5 " " " " i686-linux-64int " " " " x86_64-linux " " " " " auto " man " " man1 " " man3 " share " " man " " " man1 " " " man3

The overall pattern seems to be:

a) there are 3 basc places where stuff gets put: install/lib, install/lib/perl5, and install/lib/site_perl

b) there are subtrees according to Perl version under each, e.g. install/lib/PERL-VERSION or install/lib/site_perl/5.10.0

c) there are arch specific subtrees under these, like x86_64. But the arch names are not always consistent, e.g. x86_64-linux and i686-linux-64int

c') there are auto directories under some of the above, mainly the arch specific stff.

As you can see, I have many different versions of Perl installed. Or at least my employer does. (Reason: always want to create old scripts running, even though may install new versions of Perl for new stuff.) Currently we have versions that include 5.6.1, several versions of 5.8.x, and 5.10.0. 32/64. Threaded/non.

The default CPAN, Build.PL, etc. seem to create a lot of Perl version specific trees.

It looks like I have to install modules like File::Spec::Links multiple times - in subtrees for each of the Perl versions for scripts that will need to use them.

I understand why I need to do this if there are binaries or C libraries that need to be linked with. But why is this needed for straight scripts?

Believe it or not, but I actually am running out of diskspace. Plus the hassle of having to install multiple times.

When is it safe to put something like install/lib/5.8.5 on the PERL5LIB path for a perl 5.10.x script?


In reply to Why do Perl and CPAN use so many different install directories? by glew

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.