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.


git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@30 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2009-10-10 16:22:27 +00:00
parent f5ac2b6b75
commit ee04074296
3 changed files with 17 additions and 6 deletions

View File

@@ -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

View File

@@ -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<http://www.perl.com/perl/misc/Artistic.html>
=head1 VERSION
1.3
1.4
=cut

2
README
View File

@@ -98,4 +98,4 @@ AUTHOR
VERSION
2.03
2.04