Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Why does PERL5LIB need to be so verbose?

by kiz (Monk)
on Oct 21, 2013 at 15:08 UTC ( #1059127=perlquestion: print w/ replies, xml ) Need Help??
kiz has asked for the wisdom of the Perl Monks concerning the following question:

I am happy installing modules locally, for a given user (or service) - for example, installing CPAN modules under /home/services/foo/perl5

I'm happy that this makes a tree of directories, for packages which compile OS-Specific code, or packages which compile location-specific code.... but I'd like enlightened on two things:

  1. What is the rational for the proliferation of directories:
    • /home/services/foo/perl5/lib/<perl-version>
    • /home/services/foo/perl5/lib/<perl-version>/<OS>
    • /home/services/foo/perl5/lib/site_perl/<perl-version>
    • /home/services/foo/perl5/lib/site_perl/<perl-version>/<OS>
    • /home/services/foo/perl5/lib/site_perl/lib/<perl-version>
    • /home/services/foo/perl5/lib/site_perl/lib/<perl-version>/<OS>
    • /home/services/foo/perl5/lib/site_perl/lib/site_code
  2. .. and why do I need to specify all of them in PERL5LIB?
    • Why can't Perl expand /home/services/foo/perl5/lib/ as it does for the default library path?
    • Is there a magic subset that auto-magically includes subdirectories?


-- Ian Stuart
A man depriving some poor village, somewhere, of a first-class idiot.

Comment on Why does PERL5LIB need to be so verbose?
Select or Download Code
Re: Why does PERL5LIB need to be so verbose?
by Anonymous Monk on Oct 21, 2013 at 20:12 UTC
    You should probably look at the output of perl -V to disabuse yourself of the "auto-expansion" fantasy implied in Q2.1
Re: Why does PERL5LIB need to be so verbose? ( INSTALL_BASE the local::lib way)
by Anonymous Monk on Oct 22, 2013 at 00:29 UTC

      From what I think I read (well, I read - its the understand that harder :chuckle: ) this is about installing packages locally, but making them visible globally.

      I've no problem installing locally, and I need them to remain local - an example is Mod-Perl: this compiles against a specfic apache install, so you cannot use the Mod-Perl packages installed in the library path with any other apache server...

      .... on the other hand, I think it has sparked enough for me to get a more concise PERL5LIB: export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5/lib/perl5/site_perl



      -- Ian Stuart
      A man depriving some poor village, somewhere, of a first-class idiot.

        this is about installing packages locally, but making them visible globally.

        Almost, its about installing them locally and making them visible without extra typing -- what you should be doing

        I've no problem installing locally

        I think you do have a problem because it looks like you're not using the INSTALL_BASE method; there is a site_perl in your $HOME/perl5

        If what you've got is a whole perl installation in your $HOME/perl5 then don't mess with PERL5LIB simply call the correct perl, like $HOME/perl5/bin/perl myapp.pl .... and all those directories will be in @INC already

        Or simply use the correct shebang in myapp.pl like #!/h/o/m/e/perl5/bin/perl --

Re: Why does PERL5LIB need to be so verbose?
by Anonymous Monk on Oct 23, 2013 at 01:11 UTC
    Why was it named stdio.h? Why did they say: hello world? ... Inquiring minds really want to know. Really.
      shh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1059127]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-12-25 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (161 votes), past polls