[htmltmpl] [question] efficient use of HTML::Template->new
Brought to you by:
samtregar
From: C H. <hag...@ep...> - 2004-04-15 05:57:39
|
Wondering if anyone has input regarding the use of: HTML::Template->new It would seem (to me) that from a performance standpoint, only calling a template as it is needed is the most efficient approach. My question has to do with the actual impact of HTML::Template->new In a script, when I only use a given template one time, I only call it in the one location where it's needed When the template is used globally (every time the script is fired off), I call the template at the beginning of the script - one time. My question has to do with templates that are potentially used in many areas of the script, even though only once. In other words, there may be various ways the script can be triggered that will require a given template (and many ways the script can be called where the template isn't needed). To avoid code clutter, what I'd like to do is call all my templates in one spot: my $temp1 = HTML::Template->new( etc ... my $temp2 = HTML::Template->new( etc ... my $temp3 = HTML::Template->new( etc ... But my concern is that the approach would not be "server friendly". That said, I'm thinking that the overhead for template calls is so small, I need not be concerned. Hopefully, some on the list can enlighten me. Carl Hagstrom |