On Tue, 2004-07-27 at 21:20, Bryn Dyment wrote: > I'm wondering if this approach to using variables in Perl modules (and > setting/accessing these variables during a request) is sane (both for > a $dbH and a "generic" variable):
Putting anything stateful in globals is a questionable practice, because these globals will not be reset if your code dies half way through a request. It's better to use $r->pnotes() for storing this kind of stuff, because it gets cleaned up automatically at the end of every request, even if your code blows up. However, there is no sharing of variables under mod_perl, so no one else can affect your globals during a request. - Perrin -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html