Subject: | Problem saving configuration changes when using PERL5_CPANPLUS_CONFIG |
Im using CPANPLUS as a non root user to install modules to a custom location in my user account. First things first CPANPLUS rocks! I really like the new features and am promoting it to the other developers in my department. Now back to our regularly scheduled bug. Im using a custom configuration file (~/.cpanplus/config) by setting PERL5_CPANPLUS_CONFIG. When I make a change to my settings, do a s save, exit and restart the shell my changes are lost.
I did a little poking around and found my changes they were save to a file name 1 in my current directory not ~/.cpanplus/config.
After looking at the code I think the problem is in Configure.pm
sub _load_cpanplus_config {
my $tried;
if ( defined $ENV{PERL5_CPANPLUS_CONFIG} ) {
eval qq[require q|$ENV{PERL5_CPANPLUS_CONFIG}|];
$tried++;
$INC{'CPANPLUS/Config.pm'} = 1 unless $@;
}
I changed:
$INC{'CPANPLUS/Config.pm'} = 1 unless $@;
To this:
$INC{'CPANPLUS/Config.pm'} = $ENV{PERL5_CPANPLUS_CONFIG} unless $@;
and s save worked correctly.
Cheers,
Gayle
Gayle Dunham
gdunham@fas.harvard.edu
617-384-7763
ICG Developer
Instructional Computing Group
http://icg.fas.harvard.edu/
Faculty of Arts and Sciences Computer Services
Harvard University
PS System Info:
CPANPLUS-0.049.tar.gz
This is perl, v5.8.0 built for i386-linux-thread-multi
Linux us04 2.4.20-20.9smp #1 SMP Mon Aug 18 11:32:15 EDT 2003 i686 i686 i386 GNU/Linux