Personally I use HTML::Tree, which is an unfortunately named module that conflicts with the CPAN module of the same name. I use this for two reasons. The first is the templated HTML is fully valid HTML; it can be validated via the w3c, viewed without the code at all, and edited by WSYWYG HTML editors. The second is it changes the paradigm from the code driving the HTML to the HTML driving the code.
As for different sections of content, for serious web apps we use a framework that uses a set of perl objects to render a page, and allow SSI include processing to bring the pieces of a page together. The entire page is then templated, and viewable as a whole, and (almost) regular HTMLand the code for the application is broken down into bite sized, reusable components.
PHP and friends keep the code and its relevant HTML together, but I dislike tying the two together. I feel embedding the code in the HTML is just as bad as embedding the HTML in the code; and I feel that extra tags for templating is just putting the code in the HTML in a different language. :)
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.