--- Form.pm.orig 2008-12-14 01:38:03.722225598 -0800 +++ Form.pm 2008-12-14 21:28:42.495440344 -0800 @@ -655,19 +655,32 @@ { my $self = shift; my $name; + ### so name is undef right now + + ### name will stay undef if the following if fails $name = shift if (@_ % 2) == 1; # odd number of arguments + ### there is no assignment to name following this, so it remains undef + ### if it was before # try to find first submit button to activate for (@{$self->{'inputs'}}) { next unless $_->can("click"); - next if $name && $_->name ne $name; + ### the next line will fail if $name is undef + # next if $name && $_->name ne $name; + ### so we replace it with this: + next if (defined($name) && ($_->name ne $name)); next if $_->disabled; return $_->click($self, @_); } - Carp::croak("No clickable input with name $name") if $name; + ### since there was no assignment to $name in the above loop, + ### the following line will also fail if $name is undef, so replace: + # Carp::croak("No clickable input with name $name") if $name; + ### with: + Carp::croak("No clickable input with name $name") if defined($name); $self->make_request; } +### here $name goes out of scope, so no further concern with it is necessary =item @kw = $form->form