Skip Menu |

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

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

People
Owner: tlinden [...] cpan.org
Requestors: martink [...] bcgsc.ca
Cc:
AdminCc:

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



Uninitialized value warning triggered when -AutoTrue is used and a variable without a value is parsed. For example -- 01.conf a = 10 b = 10 -- works, but -- 02.conf a = 10 b -- triggers undefined warning. Uncaught exception from user code: not defined at /home/martink/perl/5.10.0/lib/site_perl/5.10.0/Config/General.pm line 1053 This is due to the fact that in _parse_value() the $value may be set to undef and subsequently tested with _interpolate and rx matches. # avoid "Use of uninitialized value" if (! defined $value) { $value = undef; # bigfix rt.cpan.org#42721 q(); } if ($this->{InterPolateVars}) { $value = $this->_interpolate($config, $option, $value); } # make true/false values to 1 or 0 (-AutoTrue) if ($this->{AutoTrue}) { if ($value =~ /$this->{AutoTrueFlags}->{true}/io) { $value = 1; } elsif ($value =~ /$this->{AutoTrueFlags}->{false}/io) { $value = 0; } } I suggest the following fix. if (! defined $value) { $value = undef; # bigfix rt.cpan.org#42721 q(); } else { ... Interpolate and AutoTrue checks here }
Hi, the patch in bug#54583 would fix this one too, so I'll close this. Thanks for reporting it.