|Perl Monk, Perl Meditation|
One big fat memory resident variable reachable by other scriptsby DreamT (Pilgrim)
|on Oct 12, 2009 at 17:26 UTC||Need Help??|
DreamT has asked for the
wisdom of the Perl Monks concerning the following question:
I might be asking for something impossible here, but...
I want to store a big pile of data, preferably stored as a hash, resident in memory so that it can be reached by other scripts. The variable is to contain phrases in different languages, so when I supply an ID and a language code (for example 'phrase005'and 'EN'), the resulting data would be the value for the keys 'phrase005' and 'EN'.
So, script 1 is supposed to create the var. in memory and fill it with data, and to destroy it if necessary.
Script 2 is supposed to read and use the data.
Is it even possible to work like this in Perl?
FastCGI and databases aren't options.
UPDATE: Thank you for all your answers! I will have a look into each of the solutions listed below.
The "database out of question" question is because that the scripts themselves are quite db-intensive. But I guess, it's an option too, since it's about storing it in memory using a quite small db engine...