Skip Menu |

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

Report information
The Basics
Id: 27686
Status: resolved
Priority: 0/
Queue: Config-Auto

People
Owner: Nobody in particular
Requestors: fbicknel [...] nc.rr.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.20
Fixed in: (no value)



Subject: wacky config causes config::auto to barf
If you give it a config file that looks like this: [part one] This: is garbage You'll get: Use of uninitialized value in numeric gt (>) at /users/fbicknel/lib/Config/Auto.pm line 139, <$config> line 3. at /users/fbicknel/lib/Config/Auto.pm line 139 Config::Auto::score('ARRAY(0x3f9b50)') called at /users/fbicknel/lib/Config/Auto.pm line 69 Config::Auto::parse('config') called at tryConfigAuto line 7 If you initialize %score (or there are numerous other solutions): sub score { my $data_r = shift; return (xml => 100) if $data_r->[0] =~ /^\s*<\?xml/; return (perl => 100) if $data_r->[0] =~ /^#!.*perl/; my %score = ( bind => 0, colon => 0, colonequal => 0, equal => 0, ini => 0, irssi => 0, list => 0, perl => 0, space => 0, xml => 0, yaml => 0, ); for (@$data_r) { ... then you get clean results. The above invalid config file just returns an undef in this case. Hope this helps!
On Thu Jun 21 14:26:43 2007, fbicknel wrote: Show quoted text
> If you give it a config file that looks like this: > > [part one] > This: is garbage > > You'll get: > > Use of uninitialized value in numeric gt (>) at > /users/fbicknel/lib/Config/Auto.pm line 139, <$config> line 3. > at /users/fbicknel/lib/Config/Auto.pm line 139 > Config::Auto::score('ARRAY(0x3f9b50)') called at > /users/fbicknel/lib/Config/Auto.pm line 69 > Config::Auto::parse('config') called at tryConfigAuto line 7
This warning has been silenced and a test case for it has been added and will appear in the next stable release. Thanks for reporting.