in reply to using WWW::Mechanize with more than 1 submit button

Hi, Is this (your code) work?
my $form = $agent->current_form(); $agent->{req} = $form->find_input("list_PagingMove", undef, 3)->cli +ck($form); $agent->{res} = $agent->_do_request();
> I tried this code, but for me its getting Internal Server Error. Error as ...
Can't locate object method "_do_request" via package "WWW::Mechanize" +at /usr/fweb/mydomain/cgi-bin/test.pl line 37. Line 37 : - $agent->{res} = $agent->_do_request();
If you can find out the error, pls post a comment here. Thanks

20030707 Edit by Corion: Fixed formatting

Replies are listed 'Best First'.
Re: Re: using WWW::Mechanize with more than 1 submit button
by Corion (Patriarch) on Jul 07, 2003 at 12:09 UTC

    In the current versions of WWW::Mechanize, the _do_request method (which was considered private anyway) has been superseeded by the request() method. So most likely you will be able to replace that line by

    $agent->{res} = $agent->request($agent->{req});

    Note that I did not test this, as I don't have access to WWW::Mechanize in a testable form here.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Re: using WWW::Mechanize with more than 1 submit button
by revdiablo (Prior) on Jul 07, 2003 at 20:25 UTC

    As Corion rightly pointed out, the code in my original post used WWW::Mechanize in a non-standard fashion (you'll notice I made note of this in the original post as well). When I wrote the code, I was working around a problem with the interface -- hopefully that problem has now been corrected.

    I haven't touched this code in a while, but I might reassess to see if I can use it in a more polite manner. You should try using WWW::Mechanize the way it is described in its perldocs; it might just work. :^)