I'm working on a big complicated system in which I've outputted lots of HTML with CGI.pm (writing tables is still almost irresistibly compact with CGI.pm).

But despite that we've never had a dedicated HTML person -- it's still engineers writing both HTML and doing the programming -- I've regretted it, and have been very happy we're almost through migrating to a template solution.

Outputting the HTML programatically makes it too damn easy to do things that'll bite you in the butt... like having a given page ultimately made from bits of codes scattered across your script and multiple modules, such that wanting to change a given something about the page can create a headache first in just finding where to make the change.

If you want to make comprehensive changes to your pages' appearance, where you have to look is isolated in advance with a templating system.

Having them intermingled makes it easy to break program logic when you just wanted to make a change to the display elements. You'll probably find and fix the problem readily enough, but probably could have avoided it all along with a templating system in which, when you're modifying, testing and debugging how something looks, you know that's all you're doing.

Plus all the good advice you've already heard about what happens when an HTML person is added, the advantages of using an HTML editor, etc., etc.

Unless you're sure the program's a one-time knock-off for only your own use, writing your HTML with CGI.pm is false laziness.


In reply to Re: HTML::Template vs. CGI.pm by Zed_Lopez
in thread HTML::Template vs. CGI.pm by hacker

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.