Mark-
you can not ensure that in-memory structures will be processed by the
same server/child, let alone be available to another script.
You'll need to find an inter-process store for your persistent item
if you're using something that provides for sessions ( ie
Apache::Session ) you can just stuff the data in there.
Otherwise Your best options are:
an RDMBS
a memcached store
If you are only using 1 server , you could use a local storage option:
some shared db store ( like berkley db , or a dbm )
a flat-file store
a tied file
one of the shared memory modules ( like FastMMap )
If you're only on 1 machine and can't use a session, i'd suggest
using an rdbms like mysql, postgres or sqlite. the advantage is that
you can run a quick cronjob that deletes keys that have been inactive
for 30minutes or so.
There is one ugly other option -- you could turn your data structures
into a serialized form, and either enccypt or digitally sign them,
and then have them sent back to the server and processed. you see
that a lot in asp pages. its damn messy and causes a ton of excess
bandwidth and processing power. pages with 2k of content quickly
have 130k of session data in them. i'd highly recommend against it.
On May 23, 2007, at 6:12 PM, Mark Henry wrote:
Hi,
I've done a decent amount of work in a particular script which
reads a (flatfile) database, builds some data structures (hashes of
arrays of arrays) does some processing and spits out a form.
I then want the user to choose some values on the form, submit it,
then I would act upon that, ultimately updating the original data
structure and writing out the mods - sounds pretty standard..
My question is, if I choose to handle the form submission
(action="...") via a second (etc. etc.) script, how do I ensure my
in-memory data structures will be available to that other script?
I'm new to cgi/mod-perl, though I gather one could submit back to
the same script - though this sounds like a pretty unscalable
operation over the long haul, that is having *all* code in one script.
Can someone point me down the right path? I have a feeling
packages might have something to do with it - all my variables/
structures are lexically scoped as is..
I apologize if this is not the right forum, but I am using mod_perl!
Many thanks,
Happy Star Wars 30th!
-Mark
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
| SyndiClick.com
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -