Skip Menu |

This queue is for tickets about the Config-General CPAN distribution.

Report information
The Basics
Id: 30063
Status: resolved
Priority: 0/
Queue: Config-General

Owner: tlinden [...]
Requestors: ville.skytta [...]

Bug Information
Severity: Important
Broken in: 2.35
Fixed in: (no value)

Subject: Fix for #27225 breaks setting defaults for non-toplevel variables
Download (untitled) / with headers
text/plain 307b
The fix for bug #27225 breaks setting default values for non-toplevel variables - the stack is apparently cleared from defaults as well. This breaks the W3C Markup Validator. The attached patch contains a quick patch for the test suite which causes it to fail with 2.36 but it works as expected with 2.33.
Subject: t.patch
Download t.patch
text/x-diff 958b
diff -up t/cfg.17~ t/cfg.17 --- t/cfg.17~ 2007-10-17 09:49:29.000000000 +0300 +++ t/cfg.17 2007-10-17 20:30:23.000000000 +0300 @@ -1 +1,4 @@ home = /home/users +<foo> +quux = $bar +</foo> diff -up t/run.t~ t/run.t --- t/run.t~ 2007-10-17 09:49:29.000000000 +0300 +++ t/run.t 2007-10-17 20:31:10.000000000 +0300 @@ -121,12 +121,16 @@ else { # testing value pre-setting using a hash my $conf17 = new Config::General( -file => "t/cfg.17", - -DefaultConfig => { home => "/exports/home", logs => "/var/backlog" }, + -DefaultConfig => { home => "/exports/home", logs => "/var/backlog", + foo => { bar => "quux" }}, + -InterPolateVars => 1, -MergeDuplicateOptions => 1, -MergeDuplicateBlocks => 1 ); my %h17 = $conf17->getall(); -ok ($h17{home} eq "/home/users", "Testing value pre-setting using a hash"); +ok ($h17{home} eq "/home/users" && + $h17{foo}{quux} eq "quux", + "Testing value pre-setting using a hash"); ### 18
Download (untitled) / with headers
text/plain 137b
Great. I think I'll rollback the last change and solve #27225 using another way. The interpolation code is a mess, I should rewrite it...
Download (untitled) / with headers
text/plain 105b
The problem is in General/, however I don't know how to fix it yet. I need more beer...
Download (untitled) / with headers
text/plain 370b
Well, finally I completely rewrote the variable stack system, the stack is now stored directly inside the hash. 'make test' (including your patch) runs successfull, my own programs using the module are working too. However it would be nice if you could test the new code with your program. Apply the attached patch to a fresh 2.36 source directory. Thanks in advance.

Message body is not shown because it is too large.

Fixed in 2.37, 'make test' patch have been applied.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to