Only1KW has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using CPAN Config.pm instead of MyConfig.pm
by choroba (Cardinal) on Jul 22, 2011 at 20:58 UTC | |
by Only1KW (Sexton) on Jul 22, 2011 at 21:05 UTC | |
|
Re: Using CPAN Config.pm instead of MyConfig.pm
by jpl (Monk) on Jul 23, 2011 at 20:49 UTC |