EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I been looking at cgi.pm and I can't find a way to pass all the information I stored within a hash onto the same cgi script. I cannot use database. Thanks

Replies are listed 'Best First'.
Re: Perl/Cgi: Passing Hash Data Within
by Aristotle (Chancellor) on Jan 24, 2005 at 23:37 UTC

    If you have to pass data back and forth without using storage on the server (not even files), I'd suggest you use Storable to stick it in an undisplayed form field. You might be better served using CGI::Session with a file-based session store, though.

    Makeshifts last the longest.

      is there anything that won't use files?
        Yes,

        You can build your cgi page looping through your hash keys and creating a dynamic page. Then re-assign the values and pass them in as hidden parameters.

        As long as you import your parameters into each form tag and then submit them out you can pass parameters for ever.

        Here is somewhat of an in depth example but I am sure you can see how I have passed them in the code.

        Here I assign the values from the hash at first but once loaded I pass them using hidden parameters. You can see a working example of this script here.

        Hope this is of some use to you.

        Look closer, I already answered that… :-)

        Makeshifts last the longest.