in reply to Re^2: CGI and persistent data
in thread CGI and persistent data

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.

Replies are listed 'Best First'.
Re^4: CGI and persistent data
by stevieb (Canon) on Aug 28, 2009 at 12:15 UTC

    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

    Steve

      Woah, bad perl-fu going on there. I can't see it working, at least not in any concievably portable way. The /dev/shm method gives you access at the speed of memory; why try to roll your own?

      As an alternate suggestion, if you really do want to code something yourself instead of using the previously suggested CGI::Application::Plugin::Session -- Try using FastCGI. You gain persistence of your program, so you can just use standard Perl variables to store session info.

      $,=' ';$\=',';$_=[qw,Just another Perl hacker,];print@$_;
        I'm not clear how FastCGI works in this case. Can you provide a code example?