in reply to Re: Re: Effective ways to 'write' html.
in thread Effective ways to 'write' html.

Actually, your database example wouldn't be a problem with the Template Toolkit. The TT comes with a number of 'plugins' that make interacting with various Perl features much easier. One of these is the DBI plugin.

What you would do is pass into the template, either the SQL to be executed or (more likely) some data to be used in the where clause of your SQL. The DBI plugin will connect to the database, execute the SQL and process the rows one at a time. At no time do you need to have all of the data in memory at once.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

  • Comment on Re: Re: Re: Effective ways to 'write' html.

Replies are listed 'Best First'.
Re: Re: Re: Re: Effective ways to 'write' html.
by Hrunting (Pilgrim) on Dec 19, 2000 at 19:26 UTC
    Yeah, I've seen that feature, but I thought the whole point was to remove the programming from HTML. Yes, you pass in the SQL, but the resulting template looks very much like a piece of pseudo-code with an object.method type syntax. That, to me, is an unnecessary complication. I'd like to keep that part of the programming in my program and not shop it out to the template, just like I'd like to keep the HTML part of my template out of my code.

    I think TT is fine piece of coding and good for some things, but it's not quite the sort of template I'm looking for.