I'll give you one hint that, while TIMTOWTDI, this way below is the right way :-). Namely, you create the HTML::Template every single time that you call Send_Header. Now, if you're not using mod_perl (wha..?!), this isn't really a problem, but if you are, you should create the HTML::Template for the header once for each server thread that you start. Namely that this:
sub Send_Header {
my $header_tmpl = HTML::Template->new(
filename => 'header.tmpl'
);
$header_tmpl->param(...);
...
is not as good as:
my $PACKAGE::header_tmpl = HTML::Template->new(
filename => 'header.tmpl');
...
sub Send_Header {
$PACKAGE::header_tmpl->param(...);
...
}
since in the latter version, you only create the tmpl variable once. I'm not sure how cache'ing works in HTML::Template, for but Template Toolkit 2, for example, this can be very important; if it only has to cache once, that's a significant CPU savings.
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.