From: Elizabeth Mattijsen Date: Sat, 15 Nov 2003 22:18:32 +0000 (+0100) Subject: configpm, our $summary : unique X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=90ec21fbf67fdb98944b5ea5e45d428d16982933;p=p5sagit%2Fp5-mst-13.2.git configpm, our $summary : unique Message-Id: (plus comments) p4raw-id: //depot/perl@21732 --- diff --git a/configpm b/configpm index 90e95a1..f232c9b 100755 --- a/configpm +++ b/configpm @@ -219,15 +219,18 @@ open(MYCONFIG,") || /^\s*$/; close(MYCONFIG); +# NB. as $summary is unique, we need to copy it in a lexical variable +# before expanding it, because may have been made readonly if a perl +# interpreter has been cloned. + print CONFIG "\n!END!\n", <<'EOT'; -my $summary_expanded = 0; +my $summary_expanded; sub myconfig { - return $summary if $summary_expanded; - $summary =~ s{\$(\w+)} + return $summary_expanded if $summary_expanded; + ($summary_expanded = $summary) =~ s{\$(\w+)} { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge; - $summary_expanded = 1; - $summary; + $summary_expanded; } our $Config_SH : unique = <<'!END!';