From 2a0006a8d86d4c44b17c10c88c9a5f947d73c26d Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Sat, 10 Oct 2009 16:29:34 +0000 Subject: [PATCH] 2.24 - fixed Bug #3869 (rt.cpan.org) reported by "Mike Depot" - applied patch by Roland Huss , which fixes a bug with the -Tie option, sub-hashes of named blocks were not properly created (in fact, not tied). - added documentation to Interpolated.pm that it does not interpolate variables in keys, see bug #3773 (rt.cpan.org). git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@50 be1acefe-a474-0410-9a34-9b3221f2030f --- Changelog | 15 ++++++++++++++- General.pm | 10 +++++++--- General/Interpolated.pm | 14 +++++++++----- README | 2 +- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Changelog b/Changelog index 603e169..2b78d7c 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,16 @@ + 2.24 + - fixed Bug #3869 (rt.cpan.org) reported by + "Mike Depot" + + - applied patch by Roland Huss , + which fixes a bug with the -Tie option, sub-hashes of + named blocks were not properly created (in fact, not + tied). + + - added documentation to Interpolated.pm that it does not + interpolate variables in keys, see bug #3773 (rt.cpan.org). + + 2.23 - still versioning problem, stupid white man ;-) Extended.pm is now 2.00 which *is* higher than 1.10. @@ -20,7 +33,7 @@ sets $/ if it is unset. - added patch by David Dick which - calls the bindmode() function in case the modules is being + calls the binmode() function in case the modules is being used under win32 systems. Read perldoc -f binmode for more informations on this issue. diff --git a/General.pm b/General.pm index 6b5cf0e..4a22a7f 100644 --- a/General.pm +++ b/General.pm @@ -18,7 +18,7 @@ use strict; use Carp; use Exporter; -$Config::General::VERSION = "2.23"; +$Config::General::VERSION = "2.24"; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); @@ -170,7 +170,7 @@ sub new { } else { # this happens if $#param == -1,1 thus no param was given to new! - $self->{config} = $this->_hashref(); + $self->{config} = $self->_hashref(); $self->{parsed} = 1; } @@ -611,6 +611,10 @@ sub _parse { else { # calling myself recursively, end of $block reached, $block_level is 0 if ($blockname) { # a named block, make it a hashref inside a hash within the current node $this->_savelast($blockname); + + $config->{$block} = $this->_hashref() # Make sure that the hash is not created implicitely + unless exists $config->{$block}; + if (exists $config->{$block}->{$blockname}) { # the named block already exists, make it an array if ($this->{MergeDuplicateBlocks}) { # just merge the new block with the same name as an existing one into @@ -1928,7 +1932,7 @@ Thomas Linden =head1 VERSION -2.23 +2.24 =cut diff --git a/General/Interpolated.pm b/General/Interpolated.pm index a4378c6..a1839db 100644 --- a/General/Interpolated.pm +++ b/General/Interpolated.pm @@ -1,5 +1,5 @@ package Config::General::Interpolated; -$Config::General::Interpolated::VERSION = "2.03"; +$Config::General::Interpolated::VERSION = "2.04"; use strict; use Carp; @@ -209,9 +209,13 @@ Normally you don't call it directly. =head1 VARIABLES Variables can be defined everywhere in the config and can be used -afterwards. If you define a variable inside a block or a named block -then it is only visible within this block or within blocks which -are defined inside this block. Well - let's take a look to an example: +afterwards as the value of an option. Variables cannot be used as +keys or as part of keys. + +If you define a variable inside +a block or a named block then it is only visible within this block or +within blocks which are defined inside this block. Well - let's take a +look to an example: # sample config which uses variables basedir = /opt/ora @@ -283,7 +287,7 @@ See L =head1 VERSION -2.02 +2.04 =cut diff --git a/README b/README index 6ddb05c..281a0e4 100644 --- a/README +++ b/README @@ -104,4 +104,4 @@ AUTHOR VERSION - 2.22 + 2.24