develooper Front page | perl.libwww | Postings from April 2001

Posting a Hash?

Thread Next
From:
Chris Martino
Date:
April 11, 2001 10:21
Subject:
Posting a Hash?
Message ID:
Pine.LNX.4.33.0104111313200.9240-100000@stupid.console.org
Hi-

I'm currently running a script which takes input from a text file, splits
it into 7 fields, then submits it to a form.  Code below:

   while (<FILE>) {
        ($f1, $f2, $f3, $f4, $f5, $f6, $f7) = split("\t", $_, 9999);
         $request = new HTTP::Request('POST', "http://app1.int2.fatshoe.com:7001/rebates");
         $request->content_type('application/x-www-form-urlencoded');
         $request->content("r0_f0=$f1&r0_f1=$f2&r0_f2=$f3&r0_f3=$f4&r0_f4=$f5&r0_f5=$f6&r0_f6=$f7");
         $response = $ua->request( $request );
   }

Now, this all works fine, but the form can handle several posts at once.
Notice the r0_f0, r0_f1, r0_f2, etc.  Now the form can handle an infinate
ammount of rows.  For example, if I have 300 rows to process, the 300th
row can be r300_f0, r300_f1, etc.

Currently everything is being submitted one at a time with just r0_f*.
Is there any way I can submit all the data in one clean sweep with one
form post?

TIA,
Chris


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About