> > The main thing I'm unsure of is (and this is more a mod_perl question > > than a TT one): I know that mod_perl keeps globals alive, but will it > > call the Template->new() method on every request, thus necessitating > > something like the "||=" operator, or can I simply use "=" and mod_perl > > will take care of the rest? > > It's the same as any Perl program: if you assign something to a variable, it > will overwrite what was there before. An "||=" should do what you want.
So, if I wanted global object that would only ever be initialized once, would I need to do something like run it from a startup script with PerlRequire, rather than within a handler module? (I'm basing this on something I saw in the Eagle book.) Is there any benefit to doing this with a Template object and sharing it among handler modules, or is it better to have one per module? -Tim
