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

Issuing a perl -V command reveals the following directories in @INC on my Debian Sarge machine:
/etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl
Can another Debian user kindly outline the difference between the directories and how to decide which modules should go where?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
$nysus = $PM . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: What's the difference between the many @INC directories?
by idsfa (Vicar) on Nov 14, 2005 at 20:11 UTC

    The Debian Perl Policy explains these, but basically: if you are building it yourself, use the /usr/local branch. Architecture-specific stuff goes in /usr/local/lib/perl/5.8.4/ and cross-platform goes in /usr/local/share/perl/5.8.4/ .


    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
      Great, thanks. Didn't know that doc existed, obviously.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
      $nysus = $PM . $MCF;
      Click here if you love Perl Monks

      Okay, here's what I've been able to piece together from the document you sent me to and other docs via Google. There's still some stuff I'm missing. Please correct me if anything below is wrong.

      /etc/perl
      I can't figure this one out and Google's no help. Anyone?

      /usr/local/lib/perl/5.8.4
      For modules installed "by hand" by administrator that are architecture specific.

      /usr/local/share/perl/5.8.4
      Modules installed "by hand" by administrators that will work across different platforms.

      /usr/lib/perl5
      For vendor (non-core) modules that are architecture dependent. These modules come pre-packaged and can be installed with apt-get.

      /usr/share/perl5
      For vendor (non-core) modules that are architecture independent. These modules come pre-packaged and can be installed with apt-get.

      /usr/lib/perl/5.8
      Core modules, arch. dependent, installed "out of the box"

      /usr/share/perl/5.8
      Core modules, arch. independent, installed "out of the box"

      /usr/local/lib/site_perl
      No clue. Anyone?

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
      $nysus = $PM . $MCF;
      Click here if you love Perl Monks

        /usr/local/lib/site_perl
        IIRC, this is the location for modules related to a site-specific version of Perl. For example, if you compile your own Perl with different options.
        <-radiant.matrix->
        A collection of thoughts and links from the minds of geeks
        The Code that can be seen is not the true Code
        "In any sufficiently large group of people, most are idiots" - Kaa's Law

        /etc/perl

        It appears to be used for handling conflicts between the packager's expectations and Debian's layout.

        Or as a repository (I find this one icky ... to me, it ought to be in /var!)

        Or for Config files generated at install time.

        (My Google-fu is strong)


        The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
      Normally if you're compiling modules from source, they'll just go into the right place anyway.

      just another cpan module author