On Sun, 14 Nov 1999, Leslie Mikesell wrote:

> I think a lot of unnecessary complexity comes from the fact that
> most of the template systems (and apache modules in general) want
> to output the html as a side effect instead of accumulating the
> page in a buffer or just returning a string containg the html plus
> a status value to the caller.  

That's a very strange analysis.  HTML::Template (my small contribution to
the genre) does no printing to the user - it returns a chunk of HTML ready
for the consumer or an error if something went wrong.  I don't really see
that this significantly reduces the complexity of using a templating
system!

Rather, I think that most of the simplicity of HTML::Template comes from
its strictly "one-way" interface.  The template file contains only
output-oriented structures.  Input can only come from the perl side.  I
think that much of the "slippery slope" refered to previously comes from
allowing the template file to perform processing of its own - to set
variables and call procedures, for example.

Hmmmm... Shouldn't someone be suggesting a grand-unified templating system
right about now?  Or maybe we're finally beyond that?  I hope so!  The
truth of the matter is that there is no one ultimate way to tackle
generating HTML from Perl.

The only question I'm really itching to answer is which template system is
fastest?  Maybe I should cook up a benchmark suite.  I suppose the hardest
part about that will be finding a set of templates/scripts that constitute
roughly equal tasks.  What do you all think?  After all, what's a 4H
without a bake-off?

-sam


Reply via email to