http://qs1969.pair.com?node_id=256995

kilinrax has asked for the wisdom of the Perl Monks concerning the following question:

In the process of bundling up a load of perl modules for deployment on a load of production machines, I was reminded of the sheer volume of subdirectories that seem to exist under your install PREFIX:

devapp2:~/Modules/lib$ find * -type d | egrep -v [A-Z] | fgrep -v libw +ww-perl | sed -e 's/^.\///' site_perl site_perl/5.6.1 site_perl/5.6.1/sun4-solaris site_perl/5.6.1/sun4-solaris/auto 5.6.1 5.6.1/sun4-solaris 5.6.1/sun4-solaris/auto perl5 perl5/5.6.1 perl5/5.6.1/sun4-solaris perl5/5.6.1/sun4-solaris/auto perl5/site_perl perl5/site_perl/5.6.1 perl5/site_perl/5.6.1/sun4-solaris perl5/site_perl/5.6.1/sun4-solaris/auto

Now, obviously the $ARCH and $VERSION dirs make sense, as does 'auto'; but why the need for perl5 / site_perl / perl5/site_perl? And why are modules assigned seemingly at random between those 4 directories?

Apologies in advance if this is a FAQ; but it's something I first noticed a long time ago, and have yet to find1 any explanation for.

1: google is rather unhelpful here; searching for things like 'perl module install location perl5 site_perl' gives you lots of info / problems about installing specific perl modules, as one might expect.

  • Comment on Perl module install sub-directories: perl5, site_perl, perl5/site_perl
  • Download Code

Replies are listed 'Best First'.
Re: Perl module install sub-directories: perl5, site_perl, perl5/site_perl
by crenz (Priest) on May 09, 2003 at 20:46 UTC

    I'd like to extend this question: I've always been a bit irked by the fact that when I do

    perl Makefile.PL PREFIX=/home/user/lib

    I can't do

    use lib '/home/user/lib';

    in the scripts where I'm using the library I installed. Instead, I have to go and check which directories are created and enumerate them in the use lib statement. It is even more of a nuisance when I need to share a script between different computers/architectures/versions of perl. Is there a way to make this more straightforward?

Re: Perl module install sub-directories: perl5, site_perl, perl5/site_perl
by Abigail-II (Bishop) on May 09, 2003 at 21:41 UTC
    You seem to make the premisse that everyone has such a directory set up. I have:
    /opt/perl/lib/5.8.0 /opt/perl/lib/5.8.0/auto /opt/perl/lib/5.8.0/i686-linux-64int-ld /opt/perl/lib/5.8.0/i686-linux-64int-ld/auto /opt/perl/lib/site_perl/5.8.0 /opt/perl/lib/site_perl/5.8.0/auto /opt/perl/lib/site_perl/5.8.0/i686-linux-64int-ld /opt/perl/lib/site_perl/5.8.0/i686-linux-64int-ld/auto

    I've installed Perl many, many times, and I do not recall seeing such a setup as yours.

    Abigail

      Which does beg the question; what is different about my setup to cause this?

      Even if I'm an abnormality in having a 'perl5' directory, you have 'site_perl' - which I've yet to discover an explanation for the existence of.

      Is there any reason all modules can't live in $PREFIX[/$REVISION][/$ARCH][/auto] ?

        There may be other settings that also affect directory structure, but the 2 most familiar to me are as follows (http://search.cpan.org/src/JHI/perl-5.8.0/win32/Makefile):
        # # Comment this out if you DON'T want your perl installation to be vers +ioned. # This means that the new installation will overwrite any files from t +he # old installation at the same INST_TOP location. Leaving it enabled +is # the safest route, as perl adds the extra version directory to all th +e # locations it installs files to. If you disable it, an alternative # versioned installation can be obtained by setting INST_TOP above to +a # path that includes an arbitrary version string. # #INST_VER = \5.8.0 # # Comment this out if you DON'T want your perl installation to have # architecture specific components. This means that architecture- # specific files will be installed along with the architecture-neutral # files. Leaving it enabled is safer and more flexible, in case you # want to build multiple flavors of perl and install them together in # the same location. Commenting it out gives you a simpler # installation that is easier to understand for beginners. # #INST_ARCH = \$(ARCHNAME


        MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
        I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
        ** The Third rule of perl club is a statement of fact: pod is sexy.

        You have site_perl as well. At least, you listed it. site_perl is where all your locally installed modules go, that is, all the modules that aren't part of the standard distribution. Just like that (Unix) systems have /usr and /usr/local.

        Abigail