I have just recently gotten a shell account at IO.com. The nice thing about this is that I can finally have a non-work related place to play with some of my CGI coding.

They have perl 5.005_02 with the standard distro. This includes CPAN.pm. I like CPAN.pm and tend to use it as much as possible to install modules since it notifies me of dependancy issues, etc. In preparing to use it last night, I was reviewing the documentation on how to use it with a NON-root account. It talked about global settings in the CPAN/Config.pm module and how these could be over-ridden in a ~/.cpan/CPAN/MyConfig.pm file. But there was no example of what a MyConfig.pm file would look like.

So, being the do-it-yourself-er that I am, I attempted to write my own MyConfig.pm file. I tried the following:

use CPAN::Config; $CPAN::Config->{'cpan_home'} = '/home/j/johannz/.cpan'; 1;

After some mucking about and experimenting I finally got things to work. But the MyConfig.pm that CPAN.pm wrote just overrides everything and does not use the global settings file at all it looks like.

$CPAN::Config = { 'build_cache' => q[10], 'build_dir' => q[/home/j/johannz/.cpan/build], 'cpan_home' => q[/home/j/johannz/.cpan], 'ftp' => q[/usr/bin/ftp], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gzip' => q[/bin/gzip], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/home/j/johannz/.cpan/sources], 'lynx' => q[/usr/local/bin/lynx], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'makepl_arg' => q[], 'ncftp' => q[/usr/bin/ncftp], 'no_proxy' => q[], 'pager' => q[/usr/bin/less], 'shell' => q[/usr/local/bin/tcsh], 'tar' => q[/bin/tar], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[ftp://cpan.nas.nasa.gov/pub/perl/CPAN/], q[ftp://ftp.cpan.org/CPAN/], q[ftp://ftp.perl.org/pub/perl/CPAN/], q[ftp://ftp.sunsite.utk.edu/pub/CPAN/]], 'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]], }; 1;

So, is it possible to make this file really inherit the global settings and only override the settings I need to customize?
Anyone else have experience installing and configuring modules on a box where you are not root?


In reply to User-level configuration of CPAN.pm by johannz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.