in reply to HTML::Template vs. CGI.pm

There are hundreds of good reasons. Here are my personal favorites:
  1. You can output different stuff, depending on user choices. For example, PDF::Template takes the exact same data structure as HTML::Template, but makes a PDF.
  2. You can use different languages, or even co-brand your site.
  3. You can have one person maintain your HTML and one person maintain your code. HTML::Template templates are even maintainable using Dreamweaver, Frontpage, and the like.
  4. Because your code is focusing solely on code and your display stuff is focusing solely on your display stuff.
  5. Because all the monks who have more experience than you are telling you to.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: HTML::Template vs. CGI.pm
by perrin (Chancellor) on Nov 10, 2003 at 20:47 UTC
    In addition to these reasons, I like using templates because I can edit my HTML comfortably in Mozilla Composer or Emacs HTML mode, with syntax highlighting, HTML validation, etc.
Re: Re: HTML::Template vs. CGI.pm
by LTjake (Prior) on Nov 10, 2003 at 20:38 UTC

    Good points. I'm especially fond of points 3 and 4.

    Also, why not ditch CGI.pm totally and use CGI::Simple to get a little performance boost?

    --
    "To err is human, but to really foul things up you need a computer." --Paul Ehrlich