http://www.perlmonks.org?node_id=445704


in reply to Re: Installing Perl modules locally
in thread Installing Perl modules locally

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

Replies are listed 'Best First'.
Re^3: Installing Perl modules locally
by Joost (Canon) on Apr 07, 2005 at 17:08 UTC
    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.