> ALWAYS reinitialize $Your::Singleton::ETERNAL on each query!
> mod_perl will *NOT* do it for you.

If you want a per-request global, use $r->pnotes() instead of a standard
perl global.  Then mod_perl *WILL* do it for you.

> You might think 'ah yeah but it would be nice if
> $Your::Singleton::ETERNAL could be persistent across queries...' which
> is sometimes desirable, but remember that if you have multiple instances
> of your application running on the same apache,
> $Your::Singleton::ETERNAL will be common to ALL of them.

It will be common to all requests in that particular process, but not shared
between multiple Apache processes.  If you take requests for different
applications that need different singletons on the same Apache process, you
should separate them by namespace so they don't collide.

- Perrin

Reply via email to