>>>>> "Chris" == Chris Herdt <[email protected]> writes:

Chris> Environment details:
Chris> Apache 2.2.22
Chris> Perl 5.14.2
Chris> mod_perl2 2.000007

Chris> A lot of modules are loaded, including the Util.pm in question, by the
Chris> Apache config via a PerlRequire directive.

Chris> Template->new is called once on each request. Sounds like that's
Chris> the key

You're probably just interested in getting it working again, but if you
have a lot of hacking to do, I'd suggest looking at a framework like
Catalyst which can automatically cache the Template object between hits
in a proper way.

But at another client, my quick solution was to change:

  my $template = Template->new(...);

into

  our $template ||= Template->new(...);

This works as long as there are no per-hit variables being passed into
the constructor.  Generally those are passed into ->template instead.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to