This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove constant.pm-specific behaviour from Internals::SvREADONLY
[perl5.git] / configpm
index db6d7ae..fbc4710 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -1118,6 +1118,13 @@ sub import {
     # 'configpm; was invoked with --cross option
     $platform = '***replace-marker***';
   }
+  #a Perl debugger can load a bunch of modules before -MCross with PERL5DB env
+  #var, stopping a cross compile Config.pm from being loaded because the native
+  #Config.pm was already use'd
+  if(exists $INC{'Config.pm'}) {
+    warn "Cross.pm found Config.pm is already loaded, reload required, will delete from %INC";
+    delete $INC{'Config.pm'};
+  }
   @INC = map {/\blib\b/?(do{local $_=$_;s/\blib\b/xlib\/$platform/;$_},$_):($_)} @INC;
   $::Cross::platform = $platform;
 }