* [EMAIL PROTECTED] ([EMAIL PROTECTED]) [000608 11:07]:
> I'm curious Matt, as opposed to what?, reparsing the template each
> run?  Clearly reparsing would be a big loser in terms of performance.
> 
> But what other technique could be used..., hrm.., without direct
> control over the pipe, I really don't think it would get too much
> better than this.  I mean, you could yank out sections and stuff it
> into an array that would be like: text, coderef, coderef, text, etc.
> Like in an ASP template you would parse the file, grab sections
> between <% %> and eval it as a code ref, and stuff it into your array.
> But this would probably not work specifically in ASP's case, but you
> might be able to pull it off in Embperl.  (Unless the array itself
> could also point to arrays, etc.)  Overall..., I think compiling it
> directly makes a lot more sense in 99.999% of template languages...,
> otherwise you'd end up putting too many restrictions on the template
> language itself.
> 
> Hmm..., sort of an interesting question, what ways could be utilized
> in order to maximize speed in template execution.  I thought about
> this a while ago, but after the fact I have to agree with Matt...,
> just evaling each template as a package, or a code ref would be a
> lot quicker, and if you could cook up another scheme, the resulting
> code complexity might not pan out to be worth it.

The newest version of Template Toolkit (currently in alpha) supports
compiling templates to perl code. See about 2/3 of the way down the
the README at www.template-toolkit.org. Why reinvent the wheel? :)

Chris

-- 
Chris Winters
Internet Developer    INTES Networking
[EMAIL PROTECTED]    http://www.intes.net/
Integrated hardware/software solutions to make the Internet work for you.

Reply via email to