diff options
author | Elizabeth Mattijsen <liz@dijkmat.nl> | 2003-11-15 23:18:32 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-11-16 16:09:34 +0000 |
commit | 90ec21fbf67fdb98944b5ea5e45d428d16982933 (patch) | |
tree | b15b614375710e4524313cc09238b79ede868c07 /configpm | |
parent | ecae49c0159ae97ce603c12b29343825a18c1cf1 (diff) | |
download | perl-90ec21fbf67fdb98944b5ea5e45d428d16982933.tar.gz |
configpm, our $summary : unique
Message-Id: <p05111b03bbdc478d10cb@[192.168.56.3]>
(plus comments)
p4raw-id: //depot/perl@21732
Diffstat (limited to 'configpm')
-rwxr-xr-x | configpm | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -219,15 +219,18 @@ open(MYCONFIG,"<myconfig.SH") || die "open myconfig.SH failed: $!"; do { print CONFIG $_ } until !defined($_ = <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!'; |