X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=configpm;h=c64af8a13b97eebefa0b4d8c2a357f9055c224f0;hb=97017a809da405a36dfccf88d7bd13d26ca0e932;hp=dd9e85803db907ecb14907044e2440c5a230fa84;hpb=a6c403648ecd5cc72235fdb1e7535523a8ff2ac9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/configpm b/configpm index dd9e858..c64af8a 100755 --- a/configpm +++ b/configpm @@ -17,17 +17,33 @@ 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"; +print CONFIG <<'ENDOFBEG_NOQ', <<"ENDOFBEG"; package Config; use Exporter (); -\@ISA = (Exporter); -\@EXPORT = qw(%Config); -\@EXPORT_OK = qw(myconfig config_sh config_vars); +@EXPORT = qw(%Config); +@EXPORT_OK = qw(myconfig config_sh config_vars); + +# Define our own import method to avoid pulling in the full Exporter: +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); + *{"$callpkg\::Config"} = \%Config; +} + +ENDOFBEG_NOQ +die "Perl lib version ($myver) doesn't match executable version (\$])" + unless \$^V; -\$] == $myver - or die "Perl lib version ($myver) doesn't match executable version (\$])"; +\$^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.