Move compiler OP class information into opcode.pl.
[p5sagit/p5-mst-13.2.git] / configpm
index f160177..0c6a965 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -70,8 +70,8 @@ print CONFIG "\n",
 print CONFIG "my \$summary = <<'!END!';\n";
 
 open(MYCONFIG,"<myconfig") || die "open myconfig failed: $!";
-1 while( ($_=<MYCONFIG>) !~ /^Summary of/);
-do { print CONFIG $_ } until ($_ = <MYCONFIG>) =~ /^\s*$/;
+1 while defined($_ = <MYCONFIG>) && !/^Summary of/;
+do { print CONFIG $_ } until !defined($_ = <MYCONFIG>) || /^\s*$/;
 close(MYCONFIG);
 
 print CONFIG "\n!END!\n", <<'EOT';
@@ -79,7 +79,8 @@ my $summary_expanded = 0;
 
 sub myconfig {
        return $summary if $summary_expanded;
-       $summary =~ s/\$(\w+)/$Config{$1}/ge;
+       $summary =~ s{\$(\w+)}
+                    { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;
        $summary_expanded = 1;
        $summary;
 }
@@ -179,6 +180,9 @@ ENDOFSET
 
 print CONFIG <<'ENDOFTAIL';
 
+# avoid Config..Exporter..UNIVERSAL search for DESTROY then AUTOLOAD
+sub DESTROY { }
+
 tie %Config, 'Config';
 
 1;