my $forms = $mech->forms(); my $form_num; for (0..$#$forms) { if ($forms->[$_]->find_input('shopwizard')) { $form_num = $_ + 1; last; } } die("Unable to find shopwizard form\n") unless $form_num; $mech->submit_form( form_number => $form_num, fields => { shopwizard => "Winter Love Usuki Set", criteria => 'exact' } ); #### my $found; foreach (@{$mech->forms()}) { if ($forms->[$_]->find_input('shopwizard')) { # Mess with guts. $mech->{form} = $_; $found = 1; last; } } die("Unable to find shopwizard form\n") unless $found; $mech->submit_form( fields => { shopwizard => "Winter Love Usuki Set", criteria => 'exact' } );