Tim,

"our $template" will only be called on ChildStartup* therefore it will
be executed once; "$template = " is fine, but "$template ||=" won't hurt
either. ;-)

* unless this module is preloaded in which case it is only called on
ServerStartup.

Check out the new Mod_Perl Cookbook by Geoffrey Young et al for
a really good explaination on this sorta thing and more! I suggest this
because from the looks of it, all mod_perl developers should have this book!

Jay

disclaimer - if my explaination is inaccurate its because my copy has
not arrived yet - just read the few sample chapters!

> From: "Tim Noll" <[EMAIL PROTECTED]>
> [ snip ]
> 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?
>
> package Apache::Test::Cache;
>
> use strict;
> use Apache::Constants qw( :common );
> use Template;
>
> our $VERSION = '0.01';
>
> our $template = Template->new( {
>     INCLUDE_PATH    =>
> '/usr/local/apache/perl/tt/html:/usr/local/apache/perl/tt/html/include',
>     CACHE_SIZE      =>  64,
>     COMPILE_DIR     =>  '/usr/local/apache/perl/tt/cache',
>     COMPILE_EXT     =>  '.ttc',
> } );
>
> [ snip ]



Reply via email to