When variables are declared with my (under strict), they are 'reset' every time my mod_perl registry script is run. How then do i save my datastructure that took 10 seconds to build so that on the next run it doesn't have to rebuild it?
That's not your only problem. Even if you manage to keep the data in memory, you can't gurantee (in fact, on a busy server the chances are pretty slim) that the next request will hit the same server. So you'll have the data in memory, but in another process, as out of reach as if you had it on the other side of the moon.
Perhaps you'd be better of saving it in a database, a DB_File, or even a text file...
-
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.
|