So I think the issue is that when you resubmit the form, you're using
post which will try and generate a HTTP::Request object. The problem is that you already have such an object.
Here's an example from http://www.icewalkers.com/Perl/5.8.0/lib/HTML/Form.html:
use HTML::Form;
$form = HTML::Form->parse($html, $base_uri);
$form->value(query => "Perl");
use LWP;
LWP::UserAgent->new->request($form->click);
Both click and make_request return request objects, and you can see that they're using LWP's
request to send them.
I was trying to point you to this in my first post, though I admit that it was pretty unclear. Check out http://kobesearch.cpan.org/htdocs/libwww-perl/LWP/UserAgent.html#ua_gt_request_request.
See how $ua->request sends a request object? Try that on your $req which is such a request object, and let me know if that doesn't work.
Hays
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.