At 2:15 PM -0500 12/10/02, John Stokes wrote:
>Ah yes... That makes sense.
>
>That's the solution I've used in other cases (for instance, resolving a CGI
>param to a path.) Unfortunately, it's not really practical to define a bunch
>of temporary variables for a form that may have hundreds (literally) of
>input fields.

        Doing that is probably going to be easier than writing really
robust query string code. If you are worried about keeping your code short
and sweet, then use a hash:

foreach my $key ($q->param()) {
        $form_data{$key} = $q->param($key);
}

        Or even (according to the man page, although I haven't used it):

%form_data = $q->Vars();

        Be careful though, in that these simple cases won't handle
multi-value values quite the way you might expect.


        Then you can call values by name when/if you need them:

print <<FORM_END

Name: $form_data{'name'}

FORM_END

        ---Larry

>So, it looks like I'm back to where I was before: splitting the string on &
>before I process %26.
>
>That's still OK. It's a better solution than what I'm doing now.
>
>Thanks again all (esp. Larry).
>
>-John
>
>On 12/10/02 11:03 AM, "Larry Coffin" <[EMAIL PROTECTED]> wrote:
>
>>> Print >> End_form;
>>>
>>> Name: $q->param("name")
>>>
>>> End_form
>>
>> That's because you can't execute perl code within this construct.
>> It is essentially a double quoted string that just happens to span multiple
>> lines. So, this doesn't work just like:
>>
>> print "Name $q->param('name')\n";
>>
>> won't work the way you want it to.
>>
>> You have to get the value in a variable first:
>>
>> $name = $q->param('name');
>>
>> print <<End_form;
>>
>> Name: $name
>>
>> End_form
>>
>>
>> ---Larry
>>
>>
>> +------------------------------------------------------------------------+
>> | Larry Coffin, G.P.H.                                     Watertown, MA |
>> | http://www.PointInfinity.com/lcoffin/        [EMAIL PROTECTED] |
>> +------------------------------------------------------------------------+
>>
>> Money is the root of all evil, and man needs roots
>>
>>
>> -
>>
>
>--
>-John Stokes
>Computer Psychiatrist (Director of Information Technology)
>Church Resource Ministries
>[EMAIL PROTECTED]
>
>Three Pillars: Humility, Communication, Balance
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



+------------------------------------------------------------------------+
| Larry Coffin, G.P.H.                                     Watertown, MA |
| http://www.PointInfinity.com/lcoffin/        [EMAIL PROTECTED] |
+------------------------------------------------------------------------+

Money is the root of all evil, and man needs roots


-



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to