FAQ
Hello list.

I am trying to install things in /usr/local/lib/site_perl as it seems
from http://www.perlmonks.org/?node_id=256995 that this is the directory
for locally installed modules.

Now, If I use perl -V:sitelib on my ubuntu box, the answer is
sitelib='/usr/local/share/perl/5.14.2';
I'd rather not use that as it is version specific and I don't
want to reinstall modules each time perl gets upgraded by the
system's package manager.

Do all (or 95%) of perl installation have a site_perl dir ?

How can I get the exact path to site_perl from shell, or from perl ?

Christophe.

Search Discussions

  • Luca Ferrari at Jul 24, 2013 at 6:29 pm

    On Wed, Jul 24, 2013 at 2:28 PM, Christophe Martin wrote:

    Do all (or 95%) of perl installation have a site_perl dir ?
    I'll bet the answer is not. However, what would make sitelib so much
    important with regard to other @INC entries? I mean, using a non-arch
    directory is fine without any regard to its name.

    Luca
  • Christophe Martin at Jul 25, 2013 at 12:15 pm
    Hello,

    Le 24/07/13 20:29, Luca Ferrari a écrit :
    On Wed, Jul 24, 2013 at 2:28 PM, Christophe Martin
    wrote:
    Do all (or 95%) of perl installation have a site_perl dir ?
    I'll bet the answer is not. However, what would make sitelib so much
    important with regard to other @INC entries? I mean, using a non-arch
    directory is fine without any regard to its name.
    You mean I could use any directory from @INC provided it is not
    version/arch specific ? Sadly, it just makes my problem harder to
    solve: Now I don't even know the name of what I am looking for.

    The question remains. How can I get the name of a/the <<directory
    name in @INC, not version/arch specific where I can install local modules>> ?

    Christophe.
  • Luca Ferrari at Jul 26, 2013 at 6:30 am

    On Thu, Jul 25, 2013 at 2:15 PM, Christophe Martin wrote:
    Hello,

    Le 24/07/13 20:29, Luca Ferrari a écrit :
    On Wed, Jul 24, 2013 at 2:28 PM, Christophe Martin
    wrote:
    The question remains. How can I get the name of a/the <<directory
    name in @INC, not version/arch specific where I can install local modules>> ?
    I guess it is not possible. I mean @INC is an array, therefore it has
    not any specific meaning for its entries that can have any order.
    Despite choosing a convention (like keeping the non-arch as
    last/first) or doing introspection on @INC values I guess it is not
    possible. You can use an environment variable.
    Why not customize your installations to have the first/last @INC entry
    to point to /usr/local/your-perl/lib?

    Luca
  • Peter Gordon at Jul 26, 2013 at 8:50 am

    On Fri, 26 Jul 2013 08:30:25 +0200, Luca Ferrari wrote:
    On Thu, Jul 25, 2013 at 2:15 PM, Christophe Martin
    wrote:
    Hello,

    Le 24/07/13 20:29, Luca Ferrari a écrit :
    On Wed, Jul 24, 2013 at 2:28 PM, Christophe Martin
    wrote:
    The question remains. How can I get the name of a/the <<directory
    name in @INC, not version/arch specific where I can install local
    modules>> ?
    I guess it is not possible. I mean @INC is an array, therefore it has
    not any specific meaning for its entries that can have any order.
    Despite choosing a convention (like keeping the non-arch as
    last/first) or doing introspection on @INC values I guess it is not
    possible. You can use an environment variable.
    Why not customize your installations to have the first/last @INC
    entry
    to point to /usr/local/your-perl/lib?
    On the off chance that you don't know about PERL5LIB, check
    http://preview.tinyurl.com/c2h35h6
    (You can control the directories which are in @INC)


    --
    Peter Gordon, petergo@netspace.net.au on 07/26/2013
  • Christophe Martin at Jul 30, 2013 at 10:41 am
    Hello.

    Le 26/07/2013 20:50, Peter Gordon a écrit :
    On the off chance that you don't know about PERL5LIB, check
    http://preview.tinyurl.com/c2h35h6
    I knew PERL5LIB, did not think of it at first, and, did
    not imagine things could be that complicated...

    Thanks for this very complete URL.

    I will use a custom directory, and run my scripts with
    the "#/usr/bin/perl -I /myowndir" trick.

    Christophe

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedJul 24, '13 at 12:28p
activeJul 30, '13 at 10:41a
posts6
users3
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase