Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 42654
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: phrstbrn [...] gmail.com
Cc:
AdminCc:

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



Subject: HTML::Form produces warnings when parsing form with select tags w/o name attribute
When calling HTML::Form->parse on a form with "select" tags which do not have a "name" attribute, HTML::Form produces a large number or warnings as follows: Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.8/HTML/Form.pm line 209 Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.8/HTML/Form.pm line 229. Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.8/HTML/Form.pm line 229. ... etc ... Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.8/HTML/Form.pm line 229. example HTML which causes warning: <select id="myselect"> <option>one</option> <option>two</option> <option>three</option> </select> I have attached a small fix, and should fix said issue in WWW::Mechanize as well (which is what is causing this repeated warning in my particular application), which calls this in it's internal update_html function. I am using HTML::Form v5.817, Perl v5.8.8 built for i386-linux-thread-multi
Subject: Form.patch
--- Form.pm 2009-01-21 23:39:50.000000000 -0500 +++ Form.pm 2009-01-21 23:40:21.000000000 -0500 @@ -205,6 +205,7 @@ $attr->{"select_$_"} = delete $attr->{$_} if exists $attr->{$_}; } + $attr->{name} = '' unless defined $attr->{name}; # count this new select option separately $openselect{$attr->{name}}++;
Applied (with tweaks). Thanks!