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

Install a CPAN module at x location

by skazat (Hermit)
on Oct 12, 2004 at 22:55 UTC ( #398722=perlquestion: print w/ replies, xml ) Need Help??
skazat has asked for the wisdom of the Perl Monks concerning the following question:

Dearest Monks,

Is there a simple way to have the CPAN shell install a module in a specific directory?

There are times when I want it to install in a directory other than what I specified as my perllib directory in CPAN's Config- for example, bundling the latest version of a CPAN module in a program I distribute.

setting:

 o conf init makepl_arg /home/myaccount/test/lib

on the CPAN shell doesn't seem to do what I want.

 

-justin simoni
!skazat!

Comment on Install a CPAN module at x location
Download Code
Re: Install a CPAN module at x location
by borisz (Canon) on Oct 12, 2004 at 23:07 UTC
    Update: I was completly wrong.
    Without testing it, does cpan not honor your PERL5LIB env var?
    export PERL5LIB=/home/myaccount/test/lib cpan
    Boris
      well, the PERL5LIB has many different perlib paths in it, separated by ':'s

       

      -justin simoni
      !skazat!

Re: Install a CPAN module at x location
by tachyon (Chancellor) on Oct 12, 2004 at 23:16 UTC

    Without CPAN you make perl install a module in a certain location using the PREFIX argument to makefile.PL

    perl Makefile.PL PREFIX=/home/acc/lib

    So I suggest you use:

    o conf makepl_arg PREFIX=/home/myaccount/test/lib

    The LIB argument lets you install binary components locally as well.

    cheers

    tachyon

      I was just a tad wrong in my initial posting, this:

      o conf makepl_arg LIB=/home/yadda/yadda/perllib

      (no init - that makes you go through all the parameters) Seems to do what I wanted,

      I've never used the, "PREFIX" thingy before, although it does seem to install binary modules a bit better.

      skazat becomes closer to enlightenment

       

      -justin simoni
      !skazat!

        However, PREFIX is not recommended, at least by the Module::Build documentation. It offers install_base as an alternative.

        Since install_base is not yet fully supported by ExtUtils::MakeMaker PREFIX is still the best choice for people using EU::MM based modules (still the majority).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://398722]
Approved by tachyon
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-08-28 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls