You load a different configuration file for each application. The last cpan command has the -j switch to do just that:
$ cpan -j some/app/Config.pm -i Foo::Bar
This last feature is not yet included in the CPAN.pm schedule, as it is experimental. However, I have been using it for several months as part of my DPAN .
If you don't like this, you just need to provide your CPAN::Config module for the specific application where Perl will find it before it finds your personal or public version. Copy the current CPAN / Config.pm to the directory of your application modules and make sure that the directory is first in @INC (possibly using the PERL5LIB environment PERL5LIB ). CPAN.pm should find this first and use it. It uses only the first one found. This is convenient when the configuration is fixed, although it is a little flexible, since you can run the code in the module. It is configured as Perl code.
If this is not enough for you, you can override CPAN::HandleConfig() in your application so that CPAN.pm does not load files. Then you set the values ββyourself. This is especially convenient when you have a lot of application logic to decide in order to determine some of the configuration values. The CPAN.pm configuration is only the %CPAN::Config hash, so you just need to set the correct values ββfor the corresponding keys.
In any case, you probably want to set the "connect_to_internet_ok" configuration to false and clear your "urllist" to only have local minipacks.
source share