Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: stephen.thirlwall [...] strategicdata.com.au
Cc: TJC [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.50
Fixed in: (no value)



Subject: ForceArray causes undefined value warnings with empty config keys
This is actually a duplicate of #65860, but I thought a more descriptive subject line might be useful. A simple repro case is this single line config. novalue With -ForceArray => 1, this gives the warning: Use of uninitialized value $value in pattern match (m//) at Config/General.pm line 872
Here's a failing test case - the 2nd one throws the warning. diff --git a/t/run.t b/t/run.t index 0217d81..3a9f759 100644 --- a/t/run.t +++ b/t/run.t @@ -727,6 +727,9 @@ my $cfg53 = new Config::General(-AllowSingleQuoteInterpolation => 1, -String => my %hash53 = $cfg53->getall(); is($hash53{have}, "'1'", "check -AllowSingleQuoteInterpolation"); +# check undefined values don't throw warnings with -ForceArray rt#76953 +Config::General->new( -String => "novalue" )->getall(); +Config::General->new( -String => "novalue", -ForceArray => 1 )->getall(); # Make sure no warnings were seen during the test. ok( !@WARNINGS_FOUND, "No unexpected warnings seen" );
Subject: run.t.patch
diff --git a/t/run.t b/t/run.t index 0217d81..3a9f759 100644 --- a/t/run.t +++ b/t/run.t @@ -727,6 +727,9 @@ my $cfg53 = new Config::General(-AllowSingleQuoteInterpolation => 1, -String => my %hash53 = $cfg53->getall(); is($hash53{have}, "'1'", "check -AllowSingleQuoteInterpolation"); +# check undefined values don't throw warnings with -ForceArray rt#76953 +Config::General->new( -String => "novalue" )->getall(); +Config::General->new( -String => "novalue", -ForceArray => 1 )->getall(); # Make sure no warnings were seen during the test. ok( !@WARNINGS_FOUND, "No unexpected warnings seen" );
fixed in 2.51.