Re: Passing a hash from a form field?

[email protected]
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
Mumia W. wrote:
> On 04/30/2007 11:03 PM, [email protected] wrote:
>>
>> I actually have the book as well ('Official Guide to Programming with 
>> CGI.pm') and have practically torn it apart trying to find a way to do 
>> what I want. I've tracked down and read a number of articles and forum 
>> postings as well.
>>
>> I have a feeling that a hash can't be passed this way. Arrays and 
>> strings are no problem, but I believe the CGI protocol does not allow 
>> passing complex data structures like arrays of hashes, or hashes of 
>> hashes.
>>
> 
> You are correct that CGI does not allow you to pass HoH structures 
> directly; however, you can use Storable.pm to convert a HoH into a 
> string that can be made the value of a form element (after it's been 
> HTML-encoded).
> 
> Sessions are an even better idea for passing complex data between CGI 
> programs written by the same author. Investigate the docs for 
> CGI::Session and Apache::Session (if you're using Apache).
> 

Ahh, thank you. I will check out both of those.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.