Re: Passing a hash from a form field?
[email protected] ("Mumia W.")
| Newsgroups | perl.beginners.cgi |
|---|---|
| Message-ID | <[email protected]> |
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).