in reply to Writing frozen objects to a browser?

The following seems to work for me
#!/usr/bin/perl -w # use strict; use CGI; use FreezeThaw qw(freeze thaw); my $page = CGI->new(); my $ice_cube = freeze $page; print $page->header(); print $page->start_html(); print $page->startform(); print qq(<INPUT TYPE='HIDDEN' NAME='FROZEN' VALUE='$ice_cube'>\n); print $page->endform(); print $page->end_html();
When I call up this page in my browser the following HTML
is output
Content-Type: text/html <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML><HEAD><TITLE>Untitled Document</TITLE> </HEAD><BODY><FORM METHOD="POST" ENCTYPE="application/x-www-form-urle +ncoded"> <INPUT TYPE='HIDDEN' NAME='FROZEN' VALUE='FrT;@1|>>0|$3|CGI%4|$11|.fie +ldnames$11|.parameters%0|@0|'> </FORM></BODY></HTML>
The only thing that I can suggest is that you escape any single or double quotes that appear in the
frozen object depending on which you use to to enclose the
value of the hidden field.
Hope this helps

Replies are listed 'Best First'.
RE: Re: Writing frozen objects to a browser?
by kenpo (Initiate) on Sep 04, 2000 at 23:20 UTC
    My bad. I should have included the module I am using. In any case, I believe my trouble is caused by not dealing with non-printable characters properly.

    use Storable qw(nstore store_fd nstore_fd freeze thaw dclone);

    Thanks.