Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi!
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...

In reply to One big fat memory resident variable reachable by other scripts by DreamT

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found