in reply to WWW::Mechanize with forms
Over at http://unlocalhost.com/cgi-bin/script.cgi. Then i ran this W::M test script:use strict; use warnings; use CGI qw(:standard); print header(), start_html(), start_form(), textfield('new_primer_type'), submit('submit'), end_form(), end_html(), ; if (param('submit')) { print hr, p('You submitted ', param('new_primer_type')) ; }
And it never died ... note that even though i made both of your original scripts more 'idiomatic', the results are still the same. The only thing that i changed that might matter is the action destination of the CGI script. The reason why i did so, should be apparent, but as for what is causing your problem, i can't say ...use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $url = 'http://unlocalhost.com/cgi-bin/script.cgi'; $mech->get($url); die "Couldn't get page\n" unless $mech->success; $mech->form_number(1); die "Couldn't set form\n" unless $mech->success; $mech->field('new_primer_type', 'dummy1'); die "Couldn't set type\n" unless $mech->success; $mech->click('submit'); die "Couldn't click submit\n" unless $mech->success;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: WWW::Mechanize with forms
by Anonymous Monk on Sep 22, 2003 at 22:02 UTC | |
by jeffa (Bishop) on Sep 22, 2003 at 22:28 UTC |