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

I keep losing when I try to use the CPAN module install in my home directory. The failure occurs when installing the documentation. In my ~/.cpan/CPAN/MyConfig.pl file I have
'makepl_arg' => q[LIB=/home/dthroop/lib/perl INSTALLMAN1DIR=/home/dthr +oop/lib/perl/man/man1 INSTALLMAN3DIR=/home/dthroop/lib/perl/man/man3 +INSTALLSCRIPT=/home/dthroop/lib/perl/bin INSTALLBIN=/home/dthroop/lib +/perl/bin], 'mbuildpl_arg' => q[--lib=/home/dthroop/lib/perl --installman1dir=/h +ome/dthroop/lib/perl/man/man1 --installman3dir=/home/dthroop/lib/perl +/man/man3 --installscript=/home/dthroop/lib/perl/bin --installbin=/ho +me/dthroop/lib/perl/bin],
But when I try and install, e.g. Config::Simple;
% perl -MCPAN -e shell cpan[1]> install Config::Simple ... Appending installation info to /home/dthroop/lib/perl/i386-linux-threa +d-multi/perllocal.pod !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! ERROR: Can't create '/usr/local/share/man/man3' Do not have write permissions on '/usr/local/share/man/man3'
I thought I'd told CPAN to install it in my home directory. Clearly, I need to put some other parameter in my config file. But what, where?

Replies are listed 'Best First'.
Re: CPAN modules losing in home directory
by pvaldes (Chaplain) on Aug 16, 2011 at 23:08 UTC

    First, (as user dthroop) run: perl '-V:install.*' to see what's happen with installdir. It all seems right check that /home/dthroop/lib/perl/man is not a link, and that man3 exists and is not a link

    Second: Try a manual installation, download the package and run

    perl Makefile.PL INSTALL_BASE=/home/dthroop LIB=/home/dthroop/lib/per +l INSTALLMAN1DIR=/home/dthroop/lib/perl/man/man1 INSTALLMAN3DIR=/home/d +throop/lib/perl/man/man3 INSTALLSCRIPT =/home/dthroop/lib/perl/bin IN +STALLBIN =/home/dthroop/lib/perl/bin
    (or something like this pointing to the desired directory)

    third, and probably not related, just asking... Is this correct for you? Do you want to install bin and script in the same directory?

      INSTALLSCRIPT =/home/dthroop/lib/perl/bin
      If you want to install module as regular user use "local::lib".
      $ wget http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1 +.008004.tar.gz $ tar xzf local-lib-1.008004.tar.gz $ cd local-lib-1.008004 $ perl Makefile.PL --bootstrap $ echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
      All this steps you have on cpan documentation for "local::lib".
        Can't create '/usr/local/share/man/man3' Do not have write permissions on '/usr/local/share/man/man3' I am not so sure, as I just recently started out using Perl and getting into the shell stuff.....isn't it like that that it seems that you have the "man3" but you are just not able to write in that as your error states that....so if you try out to log into the CPAN shell as root that it should work...... % sudo perl -MCPAN -e shell or locate your man3 file and change the permissions directly on man3..... please correct me if this is totally nuts...
      Thanks. /home/dthroop/lib/perl/man/man3 exists and is not a link.
      perl '-V:install.*' yields values for a root install:
      installman1dir='/usr/share/man/man1'; installman3dir='/usr/share/man/man3';
      Should it be finding ~/.cpan/CPAN/MyConfig.pl?

      Q: Do you want to install bin and script in the same directory?
      A: I thought I did; what is standard? If the scripts are in another directory, do I have to change PERL5LIB or anything?

      I'm going to try the manual install after lunch.

        mmmh... I just realize that the file in my CPAN dir is MyConfig.pm, not MyConfig.pl... I don't know if this can be a problem but its easy to check it.

        How about the manual install?