Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Install a CPAN module at x location

by skazat (Chaplain)
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.


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

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


-justin simoni

Replies are listed 'Best First'.
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.



      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

        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).

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
      well, the PERL5LIB has many different perlib paths in it, separated by ':'s


      -justin simoni

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-06-27 05:15 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (86 votes). Check out past polls.