Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Using CPAN to install in /home/dir

by Anonymous Monk
on Nov 03, 2004 at 22:11 UTC ( #405018=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone ever successfully used the cpan mod to install mods into your home directory. I don't have root access and I get tired of doing this stuff manually.

It seems that there should be some way to do something like perl -MCPAN -e 'install Some::Module' PREFIX=/home/me


Replies are listed 'Best First'.
Re: Using CPAN to install in /home/dir
by neilh (Pilgrim) on Nov 03, 2004 at 22:47 UTC
    Hi Toby,


    perldoc CPAN 5) I am not root, how can I install a module in a per- sonal directory? You will most probably like something like this: o conf makepl_arg "LIB=~/myperl/lib \ INSTALLMAN1DIR=~/myperl/man/man1 \ INSTALLMAN3DIR=~/myperl/man/man3" install Sybase::Sybperl You can make this setting permanent like all "o conf" settings with "o conf commit". You will have to add ~/myperl/man to the MANPATH envi- ronment variable and also tell your perl programs to look into ~/myperl/lib, e.g. by including use lib "$ENV{HOME}/myperl/lib"; or setting the PERL5LIB environment variable. Another thing you should bear in mind is that the UNINST parameter should never be set if you are not root.
Re: Using CPAN to install in /home/dir
by itub (Priest) on Nov 03, 2004 at 22:26 UTC
    You can set

    makepl_arg' => q[PREFIX=/home/me],

    in your ~/.cpan/CPAN/ file. (There's also a way of doing it from the CPAN shell, but I always forget and find it easier to edit the file manually.)

      Thanks to all for your suggestions. I used the makepl_arg suggestion and it worked nicely!

Re: Using CPAN to install in /home/dir
by Nitrox (Chaplain) on Nov 03, 2004 at 22:49 UTC
    Also, when installing subsequent modules make sure PERL5LIB is set properly so that any module pre-reqs can be found.


Re: Using CPAN to install in /home/dir
by saintmike (Vicar) on Nov 04, 2004 at 15:25 UTC
    In case you can read German, here's a Linux Magazin article on it.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2023-06-03 17:10 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (16 votes). Check out past polls.