Add $INC{"Config_heavy.pl"} to your debug outputExcellent idea - but it shows that the Config_heavy.pl that has been loaded is the one I expected - the one that contains the debug print(). I inserted
$INC{$config_heavy} rather than
$INC{"Config_heavy.pl"} just in case $config_heavy had been set to something unexpected. Anyway, here's the output:
D:\>perl -V:useperlio
$Config::AUTOLOAD: Config::fetch_string
$INC{$config_heavy}: E:/Perl817/lib/Config_heavy.pl
$Config::AUTOLOAD: Config::launcher
$INC{$config_heavy}: E:/Perl817/lib/Config_heavy.pl
$Config::AUTOLOAD: Config::launcher
$INC{$config_heavy}: E:/Perl817/lib/Config_heavy.pl
&Config::AUTOLOAD failed on Config::launcher at E:/Perl817/lib/Config.
+pm line 73.
I also went so far as to insert, immediately after the "require $config_heavy;" in the AUTOLOAD sub the following block of code:
open(RD, "<", $INC{$config_heavy})
or die "Can't open $INC{$config_heavy}: $!";
while(<RD>) {print $_ if $_ =~ /launcher/}
close(RD) or die "Can't close $INC{$config_heavy}: $!";
That gives the following output as I expected:
D:\>perl -V:useperlio
sub launcher {
print "\n\nrunning launcher()\n\n";
$Config::AUTOLOAD: Config::fetch_string
$INC{$config_heavy}: E:/Perl817/lib/Config_heavy.pl
sub launcher {
print "\n\nrunning launcher()\n\n";
$Config::AUTOLOAD: Config::launcher
$INC{$config_heavy}: E:/Perl817/lib/Config_heavy.pl
sub launcher {
print "\n\nrunning launcher()\n\n";
$Config::AUTOLOAD: Config::launcher
$INC{$config_heavy}: E:/Perl817/lib/Config_heavy.pl
&Config::AUTOLOAD failed on Config::launcher at E:/Perl817/lib/Config.
+pm line 77.
I've only just now discovered that if I set
$ENV{ACTIVEPERL_CONFIG_DISABLE} then the problem goes away. Of course, I don't really want to do that as I need those ActivePerl::Config values, but it does indicate that it might be a good idea to do a 'diff-u' on the respective ActivePerl::Config.pm files. I'll update this post if that leads to a resolution of this issue.
Anonymous Monk wondered whether the same behaviour occurs when I try the same thing from a script. Yes, it produces the same output.
Cheers,
Rob
UPDATE: In the end, I've simply re-installed build 817 straight over the top of the exisiting install, made my usual couple of changes to Config.pm and ActivePerl/Config.pm, and everything's working fine. I will never know what caused the problem - all I do know is that it wasn't anything in Config.pm, Config_heavy.pl or ActivePerl/Config.pm, as these files are now exactly the same as the files that got overwritten (minus my debug prints). The "usual couple of changes" I make are to set
$Config{ld} to 'g++' rather than 'gcc', and to set
$Config{lib_ext} to '.a' instead of '.lib'. That's so I can use ActivePerl with the MinGW compiler. It's just those 2 values that need to be amended - the rest are taken care of correctly.