Without looking at what you're doing, it's hard to offer suggestions to your specific site.

We use HTML::Template (and CGI::Application - check it out!) for all our CGI work, and at this point, we're pretty consistent in how we use it. The biggest help is that since you can put HTML::Template logic in your include files, we generally create top & bottom containers (headers, navigation, footers) with their own logic (if needed), and include them on all the other templates. The additional benefit is that you can then create a sub to populate the containers, and call it as needed, cleaning up your code further.

I've found that anything as small as a table, if used on multiple pages, makes a good candidate for an include. It means that both in your HTML and your perl, you'll have only one place to maintain it. Generally a good thing.

So don't try and make a single template as generic as possible - it makes things too complex and difficult to maintain. Take the common elements in all your pages, split them out into includes. The end result will be a lot cleaner.


In reply to Re: Template::HTML - what's the rule of thumb? by swngnmonk
in thread HTML::Template - what's the rule of thumb? by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.