Here's an example for you, that works OK, except for a bug that I need help with. the POST is here, and the form is below. The thing is, I can't get it to set the checkbox values and I can't find any doc anywhere to tell me how. I did this working from Orwant & Gruhl's article in TPJ 4:1. Any help would be a godsend!
sub getLinkParse { use LWP::UserAgent; use HTTP::Request::Common; $sentence = "This is a test sentence."; $response = (new LWP::UserAgent)->request(POST 'http://www.link.cs.cmu.edu/cgi-bin/link1/construct-page-4 +.cgi#submit', [ Sentence => $sentence, Constituents => "1", <<<< this is a checkbox NullLinks => "1", <<<< this is a checkbox AllLinkages => "OFF", LinkDisplay => "on", ShortLength => "6", PageFile => "/docs/submit-sentence-4.html", InputFile => "/scripts/input-to-parser", Maintainer => "sleator\@cs.cmu.edu" ] ); exit -1 unless $response->is_success; $_ = $response->{_content}; print $_; } This is the origianl form on the site: <FORM METHOD="POST" ACTION="/cgi-bin/link1/construct-page-4.cgi#submit +"> <textarea name="Sentence" MAXLENGTH=200 wrap=virtual rows=3 cols=70>< +/textarea><br> <INPUT TYPE="checkbox" NAME="Constituents" CHECKED>Show constituent tr +ee &nbsp; <INPUT TYPE="checkbox" NAME="NullLinks" CHECKED>Allow null links &nbsp +; <INPUT TYPE="checkbox" NAME="AllLinkages" OFF>Show all linkages &nbsp; <INPUT TYPE="HIDDEN" NAME="LinkDisplay" VALUE="on"> <INPUT TYPE="HIDDEN" NAME="ShortLength" VALUE="6"> <INPUT TYPE="HIDDEN" NAME="PageFile" VALUE="/docs/submit-sentence-4.ht +ml"> <INPUT TYPE="HIDDEN" NAME="InputFile" VALUE="/scripts/input-to-parser" +> <INPUT TYPE="HIDDEN" NAME="Maintainer" VALUE="sleator@cs.cmu.edu"> <br> <INPUT TYPE="submit" VALUE="Submit one sentence"> <br> </FORM>

In reply to Re: POSTing with LWP::UserAgent by Anonymous Monk
in thread POSTing with LWP::UserAgent by Intaglio

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.