Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Installing Perl modules locally

by Joost (Canon)
on Apr 06, 2005 at 19:56 UTC ( #445422=note: print w/replies, xml ) Need Help??

in reply to Installing Perl modules locally

I think the easiest way is to set the PREFIX.

Basically (from the ExtUtils::MakeMaker docs):

perl Makefile.PL PREFIX=/tmp/myperl5 make make test make install

Replies are listed 'Best First'.
Re^2: Installing Perl modules locally
by Anonymous Monk on Apr 07, 2005 at 14:31 UTC
    This sounds good. I think this will be the only library that I will need to install, so I won't need to set up my own $HOME. Please forgive my ignorance, but I want to make sure that I install the it properly. The line 'perl Makefile.PL PREFIX=/tmp/myperl5' - can I put a different dir than the one listed? I am assuming so, but I want to make sure.... Also, when this is done I should be able to call the library from my scripts without doing anything more, correct? Thanks again, EricJP
      the prefix specifies the "base directory", so everything that gets installed will get installed relative to that directory. this means that, in this example the modules will go somewhere in "/tmp/myperl5/lib/perl5/site_perl/5.8.6" (depending on your perl version number), manpages will got in "/tmp/myperl5/man/...." etc.

      If you then want to use the libraries need to make sure the perl interpreter knows where to find them: you can set the PERL5LIB environment variable to "/tmp/myperl5/lib/perl5/site_perl/5.8.6" or put use lib '/tmp/myperl5/lib/perl5/site_perl/5.8.6'; in your code.

      And yes, you can basically use any directory you like, though dirs with spaces in their name tend to cause confusion.

      If you want to have more control over which parts of the installation go where, take a look at the ExtUtils::MakeMaker documentation.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://445422]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2020-08-04 17:30 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (33 votes). Check out past polls.