My brain is starting to hurt.

I checked LWPcook, I read the other posts, all to no avail. I am trying to write a script that will grab successive web pages. The first step is to fill out a form and submit it through https to a JavaScript that will take the values given and generate a successive page, which I will also (down the road) need to munge. The relevant part of my script is:

$JSRequest = new HTTP::Request; # create new request %choices = (circuit => 'c7', district=> 'ALL', judge_type => '', jobSe +arch_year => '', judge_first => '', judge_last => '', open => 'R', closed => 'R', term => 'R', perm => 'R' +, TAB => 'viewJob', pos_open => 'on', pos_close => 'on', pos_term => 'on', pos_perm => 'on +', order_by =>'A', search => 'javascript:verify(document.forms[0])'); # save choices as associative array $JSRequest->header(Content-type => 'form-data'); # set content type $JSRequest = POST "$site", %choices; # Fill in all values expected by the form $JSRequestResult = $ua->request($JSRequest); # save response of the request stored in $JSRequest
The problem is this returns a few headers and then "You do not have a value in the TAB field." The tab field is defined in %choices. If I make
$JSRequest = POST "$site", %choices;
into
$JSRequest = POST "$site", \%choices;
I get: 500 Internal Server Error

and I have no way to check why, as the web server is not something to which I have access.

My question is: why am I getting this error? Does anyone have any ideas about how I could do this differently?

--- Chaos, fear and panic. My work here is done.


In reply to At wit's end with LWP/https by Shikko

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.