Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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.

Replies are listed 'Best First'.
Re^2: CGI and persistent data
by stevieb (Abbot) 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-06-22 04:32 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (121 votes). Check out past polls.