Thanks Jouke!
I would have spent all day trying to find that out :)
I now understand the object a lot better and have found out
that the list of variables stored in the request object is not a hash table at all ... but a STRING!! (this, i'm sure many of you know ... but i'm even more sure that there are many who don't know and may stumble across this one day)
the final code that i wound up using is
split ('&',$Request->form->Item);
foreach my $pair (@_) {
my @temp = split ('=',$pair);
$form_elements{$temp[0]} = $temp[1];
}
foreach my $key (keys %form_elements) {
$Response->write("$key = $form_elements{$key} <br>");
}
this code is used in a situation where one has submited data from one form/webpage to the next. Having all of this information in a hash will allow you to carry all that data into the next form without worrying about what the specific KEYES of each of the form elements.
There may be other ways to do this (feel free to chip in) ... but i think this is a pretty good way of doing it :)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.