Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: CGI and persistent data

by astroboy (Chaplain)
on Aug 28, 2009 at 00:17 UTC ( #791780=note: print w/ replies, xml ) Need Help??

in reply to CGI and persistent data

I'd like to be able to 'carry' the data structure without having to 'store' it to disk, if possible

well, you'll have to store the data structures somewhere. Your choices will probably be in a cookie, as a hidden param or as part of your session, And session info will typically either use a flat file or a db. As porta pointed out, you could just use CGI::Session or CGI::Application::Plugin::Session to do the latter. That would be my recommendation too, as it has a nice API for saving and retrieving the data.

Comment on Re: CGI and persistent data
Re^2: CGI and persistent data
by stevieb (Chaplain) on Aug 28, 2009 at 00:40 UTC

    Thanks porta and astroboy,

    I'll look further into keeping sessions via the modules you've recommended, particularly the ones that fall into plugins to CGI:Application. I've found so far that the documentation has been reliable and easy-to-follow for plugins related to this module path.



      If you want to store them in RAM and access them easily, think about storing them as files in /dev/shm. This gives you the advantages of memory (fast, don't care about old data after reboot) and the easiness of file access.
      Whichever solution you're using: Always remember cleaning up old items.

        This is my point

        I'm curious to learn whether I can access the data within leaked memory if I *don't* clean up the old items, particularly across Perl invocations, simply by using the known memory address


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://791780]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-01-26 14:31 GMT
Find Nodes?
    Voting Booth?

    My top resolution in 2015 is:

    Results (192 votes), past polls