This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Weed buglets pointed out by
[perl5.git] / configpm
index 66b51a4..c64af8a 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -17,7 +17,7 @@ my $glossary = $ARGV[1] || 'Porting/Glossary';
 
 
 open CONFIG, ">$config_pm" or die "Can't open $config_pm: $!\n";
-$myver = $];
+$myver = sprintf "v%vd", $^V;
 
 print CONFIG <<'ENDOFBEG_NOQ', <<"ENDOFBEG";
 package Config;
@@ -30,6 +30,7 @@ sub import {
   my $pkg = shift;
   @_ = @EXPORT unless @_;
   my @func = grep {$_ ne '%Config'} @_;
+  local $Exporter::ExportLevel = 1;
   Exporter::import('Config', @func) if @func;
   return if @func == @_;
   my $callpkg = caller(0);
@@ -37,8 +38,12 @@ sub import {
 }
 
 ENDOFBEG_NOQ
-\$] == $myver
-  or die "Perl lib version ($myver) doesn't match executable version (\$])";
+die "Perl lib version ($myver) doesn't match executable version (\$])"
+    unless \$^V;
+
+\$^V eq $myver
+  or die "Perl lib version ($myver) doesn't match executable version (" .
+    (sprintf "v%vd",\$^V) . ")";
 
 # This file was created by configpm when Perl was built. Any changes
 # made to this file will be lost the next time perl is built.