I've spent hours trying to figure this out with no luck, so I have to ask: How do I get CPAN to create and use a global configuration file for all users instead of creating one at ~/.cpan/CPAN/MyConfig.pm for each user? I'd really like to have only one configuration file so other authorized users aren't installing packages and source to the four corners of the hard drives.

I've poured over perldocs, but can't find any relevant information. The best I could find was that the FirstTime module documentation says "The init routine asks a few questions and writes a CPAN/Config.pm or CPAN/MyConfig.pm file (depending on what it is currently using)" but what does it mean by "currently using"? I've tried deleting my ~/.cpan directory and restarting cpan (and NOT configuring as much as possible automatically). I get the following from the script:

The following questions are intended to help you with the configuratio +n. The CPAN module needs a directory of its own to cache important in +dex files and maybe keep a temporary mirror of CPAN files. This may +be a site-wide or a personal directory. I see you already have a directory ~/.cpan Shall we use it as the general CPAN build and cache directory? <cpan_home> CPAN build and cache directory? [~/.cpan]

Well, the script automatically first creates a new ~/.cpan directory, so of course I "already have a directory." I've modified the "CPAN build and cache directory" to the global location, but the script still only creates MyConfig.pm in ~/.cpan.

Even if I wanted to modify a global Config.pm file, which preexisting one would I use, or if I'm supposed to create a new one, where does it go?

../lib/5.14.1/aix-thread-multi-64all/Config.pm ../lib/5.14.1/aix-thread-multi-64all/Encode/Config.pm ../lib/5.14.1/Net/Config.pm ../lib/5.14.1/ExtUtils/MakeMaker/Config.pm ../lib/5.14.1/CPANPLUS/Config.pm ../lib/5.14.1/Log/Message/Config.pm ../lib/5.14.1/Module/Build/Config.pm ../src/perl-5.14.1/lib/Net/Config.pm ../src/perl-5.14.1/lib/ExtUtils/MakeMaker/Config.pm ../src/perl-5.14.1/lib/Config.pm ../src/perl-5.14.1/lib/CPANPLUS/Config.pm ../src/perl-5.14.1/lib/Log/Message/Config.pm ../src/perl-5.14.1/lib/Module/Build/Config.pm ../src/perl-5.14.1/lib/Encode/Config.pm ../src/perl-5.14.1/cpan/libnet/Net/Config.pm ../src/perl-5.14.1/cpan/Encode/lib/Encode/Config.pm ../src/perl-5.14.1/cpan/Log-Message/lib/Log/Message/Config.pm ../src/perl-5.14.1/cpan/Module-Build/lib/Module/Build/Config.pm ../src/perl-5.14.1/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Conf +ig.pm ../src/perl-5.14.1/cpan/ExtUtils-MakeMaker/t/testdata/reallylongdirect +oryname/arch2/Config.pm ../src/perl-5.14.1/cpan/ExtUtils-MakeMaker/t/testdata/reallylongdirect +oryname/arch1/Config.pm ../src/perl-5.14.1/cpan/CPANPLUS/lib/CPANPLUS/Config.pm

In reply to Using CPAN Config.pm instead of MyConfig.pm by Only1KW

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.