According to Sam Tregar:
> 
> > 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.

Right. You don't see the problem until you add conditionals and
flow control - and perhaps not even until you try to reuse some
existing pages as sub-elements of another.  Apache is moderately
good at handling:
<--!include virtual "just about anything..." -->
within mod_include, even mixing different handlers and proxied
elements, but it is very awkward to wrap any kind of conditional
execution or parameter passing in the mod_include language, and
impossible to do anything where the condition depends on a
sub-element.

> 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.

What I'm looking for is a 'nestable' way of handling the logic
flow and HTML construction that will allow a page to be used
as a stand-alone item (perhaps displayed in a frameset) or
included in another page, but when it is included I'd like to
have the option of letting its execution return a status
that the including page could see before it sends out any
HTML.

  Les Mikesell
   [EMAIL PROTECTED]

Reply via email to