mp has asked for the wisdom of the Perl Monks concerning the following question:
Example:
Given this input:
a=7&b=1&text=Some+text+goes+here&required=Yes&submit=submit
Produce this data structure:
my $data = [ 'a' => 7, 'b' => 1, 'text' => 'Some text goes here', 'required' => 'Yes', 'submit' => 'submit', ];
The intended use is in a script that tests subroutines that are used inside of a mod_perl application. The subroutine under test expects pre-parsed post data in an array structure like that above. I'm using HTML::Form to extract and parse form data from an HTML page, then using it's $form->click method to click on various submit buttons on that page. $form->click returns an HTTP::Request object, from which I can extract the post data as a string (urlescaped and joined by ampersands), but I need to get that data properly parsed and unescaped to send it as input to the subroutine that I'm testing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing form post (content)
by Zaxo (Archbishop) on Aug 29, 2002 at 19:02 UTC | |
by mp (Deacon) on Aug 29, 2002 at 19:19 UTC | |
|
Re: Parsing form post (content)
by fruiture (Curate) on Aug 29, 2002 at 19:18 UTC | |
|
Re: Parsing form post (content)
by blokhead (Monsignor) on Aug 29, 2002 at 18:54 UTC | |
by Anonymous Monk on Aug 29, 2002 at 19:03 UTC |