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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1125
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!
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-8924-1183556398-179.27686-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 634
Download (untitled) / with headers
text/plain 634b
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.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.