In general, when you absolutely do not want it to :)

But less generally, package globals. As all subsequent requests are all handled by the same eternal Perl interpreter, and nothing resets globals automatically, they're still around if you didn't reset them yourself.

For something that takes 10 seconds, using a global isn't a great idea. Every Apache process will need to have its own copy, and will thus build it once. That means the global is only useful if you get more than a few visitors. But if you get more than a few visitors, you never want any normal page request to last 10 seconds.

My advice is to build the thing externally and then let the request handler use the static information.

And whether not being able to use other handlers is a limitation depends only on what you want. If you want to use other handlers, it is certainly a limitation. If not, then I don't see how it could be limiting.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }


In reply to Re: [mod_perl] when does it keep data in memory? by Juerd
in thread [mod_perl] when does it keep data in memory? by Jaap

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.