in reply to multiline regex

As I can see it you have 2 problems:

I will try to address then in that order (tho mabey not very well).

1. Parsing a text file.
To start with, is there any need to do a multiline regex? Unless you've formatted the datafile for our sake, one line at a time ough to work just fine.

foreach $line (@file) { chop $line; if ($line =~ /^get (.+)$/) { push (@getrequest, $1); } if ($line =~ /^post (.+)$/) { $postrequest = $1; $dataread = "true +"; } if ($dataread eq "true") { if ($line =~ /content-type: (.+)/) { $post{$postrequest}{content-type} = $1; if ($post{$postrequest}{content-type} =~ /; boundary=(.+)/ +) { $boundary = $1; } else { $boundary = ""; } } if ($line =~ /content-length: (.+)/) { $post{$postrequest}{con +tent-length} = $1; } if ($line eq "" && $boundary = "") { $contentnextline = "true" +; } if ($contentnextline eq "true") { $post{$postrequest}{content} + = $line; $contentnextline = "false"; $dataread = "false"; } if ($line eq $boundary && $boundary ne "") { $content_flag = " +true"; } if ($line eq $boundary && $content_flag eq "true") { $content_ +flag = "false"; $dataread = "false"; $post{$postrequest}{content} = \ +@content; } if ($content_flag eq "true") { push (@content, "$line\n"); } + }
Now this should (i haven't tested it) create an array and a hash of hashes with all the data you need for part 2.

Update: Ack! this post made it through. My browser hung on the submit. I didn't think it made it, and i had to run out before finishing....

Now for part 2.
You may not want to do it this way, but use the "LWP" module. It is going to give you the best, cleanest, and simplest way for the http submits.
The link above should contain all the docs you need to create the http requests.

Just loop through the elements in the get array, and the hash, and use the data to formulate the requests.

BTW- I have not tested any of the code. It would probably have to be debugged and tweaked to fit your needs.