On Wed, 22 May 2002, Cory Trese wrote:

> Scenario:
> 1.    template loaded in 'cgiapp_ini( )' method, some parameters passed into it
> 2.    template will be used in all of the children run modes -- it would also
> be convenient if they could fill in some additional parameters.
>
> Thus, the logic that found and populated the common parts of common
> HTML::Templates would be separate from the code that used them -- a much
> better system IMHO.

It's pretty rare, in my experience, for every run-mode in a
CGI::Application to share a single template.  Usually there are a few
run-modes that use a common template and most have a one-to-one
relationship with their template.

However, if you really have just one template for your whole app then you
could just load it into a package global:

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

Then you can use it in every run-mode without doing anything further.

> However, we have some concerns that perhaps passing H:T via
> the ->param( )method of C:A might occur lots of overhead or be in some
> manner bad.  Are we right?

Overhead?  No.  It's just a reference to an object, you can pass it around
all you want with no noticeable effects.  Bad?  Well, I don't think so but
that's more of a value-judgement than a statement of fact.

-sam



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to