diff --git a/Changelog b/Changelog index 94f24ea..0a421cc 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,8 @@ + 2.04 - added RFE from rt.cpan.org (ID: 1218). the ::Interpolate + module populates now uses of uninitialized variables in + config files itself instead of just letting perl die(). + The other suggestion of the RFE was declined. + 2.03 - fixed bug in the _parse() routine (better: design flaw). after the last patch for allowing whitespaces in option names, it had a problem with here-docs which diff --git a/General/Interpolated.pm b/General/Interpolated.pm index 5fc1131..34e4ff2 100644 --- a/General/Interpolated.pm +++ b/General/Interpolated.pm @@ -1,5 +1,5 @@ package Config::General::Interpolated; -$Config::General::Interpolated::VERSION = "1.3"; +$Config::General::Interpolated::VERSION = "1.4"; use strict; use Carp; @@ -70,9 +70,15 @@ sub _vars { } else { $value =~ s{$this->{regex}}{ - my $v = $varstack{$3} || $stack->{$3}; - $v = '' if ref($v); - $1 . $v; + my $con = $1; + my $var = $3; + my $v = $varstack{$var} || $stack->{$var}; + if (defined $v) { + $con . $v; + } + else { + croak "Use of uninitialized variable \$" . $var . "\n"; + } }egx; } @@ -210,7 +216,7 @@ See L =head1 VERSION -1.3 +1.4 =cut diff --git a/README b/README index df159df..148b01e 100644 --- a/README +++ b/README @@ -98,4 +98,4 @@ AUTHOR VERSION - 2.03 + 2.04