in reply to how to get useful errors with WWW::Mechanize

After looking at the (5.8.8) source code, I'd have to say that in your case I would first insure that I was using a valid form number. Then I would check your "fields" hash to make sure it is good. It looks like it expects a hash. Your best bet would be to look at line 1492 of /usr/lib/perl5/site_perl/5.8.5/WWW/Mechanize.pm on your computer.

From Mechanize.pm (5.8.8): Notice the "or die" code.

sub submit_form { my( $self, %args ) = @_ ; for ( keys %args ) { if ( !/^(form_(number|name)|fields|button|x|y)$/ ) { $self->warn( qq{Unknown submit_form parameter "$_"} ); } } if ( my $form_number = $args{'form_number'} ) { $self->form_number( $form_number ) or die; } elsif ( my $form_name = $args{'form_name'} ) { $self->form_name( $form_name ) or die; } if ( my $fields = $args{'fields'} ) { if ( isa( $fields, 'HASH' ) ) { $self->set_fields( %{$fields} ) ; } # TODO: What if it's not a hash? We just ignore it silently +? } my $response; if ( $args{button} ) { $response = $self->click( $args{button}, $args{x} || 0, $args{ +y} || 0 ); }