APM: Looking for a good HTML templating system

Brent LaVelle brentlavelle at yahoo.com
Thu Oct 27 06:25:47 PDT 2005


Warning: dated material

I started using HTML::Template a while ago for simple projects like 
http://portfolio.cunninghamarchitects.com/cgi-bin/projects found it to
be annoying.  A good example is that inside a loop if I wanted to
access variable outside the loop I had put them on each hash element I
was looping over.  I got real sick of HTML::Template fast.
Also think of tables where rowspan and colspan are >1.

However the thing I went onto you already do not want to use.  I like
Mason because of the content wrapping concept.  Wrapping things like
headers and footers around content, I found, is so much better than
including stuff.  Mason is a different way of thinking but very
powerful.  The idea of the user just hitting a page that is nothing
more than a SQL statment that is then wrapped and wrapped until it
makes a report is very powerful.

So, I'd like to bring HTML::Template down a notch and tell you to
possibly rethink the Mason solution.  I suppose I would have been a
real help if I had used something else.

--- Bob Apthorpe <apthorpe+pm at cynistar.net> wrote:

> Hi,
> 
> It's been a while since I've done any CGI programming in perl but
> recently I took on a project where we're using HTML::Template to
> render
> pages. My preference is to use a templating system to separate the
> logic
> from the presentation and most recently I've been using PHP and the
> Smarty template system for web application development. Smarty has
> its
> quirks but it's easy enough to pass complex data structures into a
> template to generate rather elaborate pages.
> 
> Not having any previous experience with HTML::Template aside from
> perldoc and some trivial examples, how do the two tools compare? Is
> there a better system to use that does not require mod_perl? I'm
> specifically eliminating HTML::Mason because it's too heavyweight for
> what I'm trying to do, i.e. I'm looking more for a templating system
> than an application framework (I'm still learning Rails...)
> 
> The application is not expected to be high traffic so it can run as a
> CGI without worrying much about performance. Conversely, this is for
> a
> client and I would rather not have to specify a highly-tuned
> ("hacked")
> Apache configuration, which is why I don't want to mess with
> mod_perl.
> 
> Google turns up
> http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html
> and after reading that, I think Template Toolkit bears some
> investigation. Still, I'd appreciate hearing people's experiences
> with
> perl templating systems.
> 
> Thanks,
> 
> -- Bob
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


More information about the Austin mailing list