in reply to [mod_perl] when does it keep data in memory?
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' }
|
|---|