in reply to I am about to write my very own templating module..

way to get perrin's attention!

My situation is very close to yours: a closet full of more or less terrible templating solutions, a strong preference for pipelining and simplicity, and a bias towards readable templates.

I also share your concern about vast machines and tiny tasks, but I've become one of the TT faithful nevertheless. Not because I need everything it does, but because it does everything I need. More than that: it does a great deal that I might need one day. I've benefited from that headroom several times already.

Just one example: I recently shifted a normal sort of "use DBI use Template" application over to a more elegant OO implementation using Class::DBI. Quite unexpectedly, it turned out that where I'd previously been pre-stuffing hashrefs, i could now use TT's marvellous 'lazy' method calls to do exactly the amount of database work that was required to populate a given template and no more. I didn't have to write any code for that purpose - just delete most of what i had - and i didn't even have to change the templates much.

(actually, if you haven't already I'd urge you to check it out: it allows you to write a more or less pipelined system yet put data retrieval and computation completely at the discretion of the template)

I suppose the point is that not only do lots of people share your present needs, they share the future needs that you don't know about yet, and they've already done the work for you...

Which isn't to say that TT is the right solution for you. it's not an easy one to install without root. But I really don't think you should be starting from scratch here.

  • Comment on Re: I am about to write my very own templating module..

Replies are listed 'Best First'.
Re^2: I am about to write my very own templating module..
by Aristotle (Chancellor) on Dec 18, 2002 at 13:46 UTC
    I just felt I had to reply to reach closure with the first question and also first post to the Monastery I ever wrote: I ended up going the exact same route. I now swear by Template Toolkit. In fact I find it hard to stick to pipelining sometimes - but I'm getting better at drawing the line between what is application logic and should be calculated in the script and what is display logic and should be done in the template. It's a great tool, albeit not the easiest one to get started with (both in terms of installation as well as usage). At this point I can no longer imagine inhabiting a host which doesn't and doesn't want to offer it.

    Makeshifts last the longest.