It seems unapproachable if you keep calling it obscure/gnarly...

#!/usr/bin/perl -- use strict; use warnings; use WWW::Mechanize; my $ua = WWW::Mechanize->new(); use URI::file; $ua->get( URI::file->new( __FILE__ )->abs(URI::file->cw +d) ); #~ $ua->get( 'file:'. __FILE__ ); $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); $ua->timeout( 1 ); $ua->update_html( <<'HTML','.');## $ua->{content} = <<'HTML'; <html> <head> <title> localhost form </title> </head> <body> <base href="http://localhost/"> <form method="POST" action="http://localhost/"> <input id="enterbutton" type="submit" name="user_choice" value="Enter" + /> <input type="submit" name="user_choice" value="Leave" /> </form> </body> </html> HTML my $form = $ua->form_number( 0 ); $form->action( $form->action . 'THE_NEW_ACTION/' ); $ua->submit; __END__ $ perl mechanize.inline.form.action.pl POST http://localhost/THE_NEW_ACTION/ Accept-Encoding: gzip Referer: file:mechanize.inline.form.action.pl User-Agent: WWW-Mechanize/1.71 Content-Length: 0 Content-Type: application/x-www-form-urlencoded (no content) 500 Can't connect to localhost:80 (timeout) Content-Type: text/plain Client-Date: Sun, 08 Jan 2012 21:03:56 GMT Client-Warning: Internal response Can't connect to localhost:80 (timeout)\n LWP::Protocol::http::Socket: connect: timeout at C:/perl/site/5.14.1/l +ib/LWP/Protocol/http.pm line 51.\n Error POSTing http://localhost/THE_NEW_ACTION/: Can't connect to local +host:80 (timeout) at mechanize.inline.form.action.pl line 39

In reply to Re^3: Very obscure WWW:Mechanize problem by Anonymous Monk
in thread Very obscure WWW:Mechanize problem by andyholyer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.