As others have mentioned, you can use LWP to post data. I thought it might be useful to give you an example of some code I've used in the past (please keep in mind I am far from an expert in this area, so I'm sure others could provide better (or at least alternative) examples):

my $ua = LWP::UserAgent->new; $ua->timeout( 600 ); my $reqobj = $ua->post( 'http://somewebsite/page.cgi', { Var1 => $value1, Var2 => $value2, Submit => 'Process query', } ); if( ${$reqobj}{_msg} ne 'OK' ) { print "\nerror posting data: ${$reqobj}{_msg}\n"; return 1; } my $results = ${ $reqobj }{_content};

The values submitted in the post method are placed in the hash that follows the URL. The website that I was using required a Submit field with the value of Process query (generated when the user hit the 'Submit' button) in order for the CGI script to process the data and return the results, so you might want to keep that in mind as your site might require something similar. Note you can test _msg for success/failure, and _content contains the results. Finally, you probably do not need to change the default setting for the timeout value of the request, but in the example above I set the timeout value to 600 seconds (10 min) (the site I was using typically takes 5-8 min to process a request).

HTH - good luck.

In reply to Re: How to send HTTP POST request? by bobf
in thread How to send HTTP POST request? by UncleRon

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.