NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Template Toolkit (Score:2)
Well, the thing that always irked me, is how templates can be "compiled" (= converted to perl code which, when executed, produces the desired output from the template) and stored to disk, for simply reloading and running later. The compiled templates must be writable by the program that compiles and uses them, in order to be able to recompile them on the fly, if necessary; and which may running under the same under-privileged user as all other users are using; for example, when running as a CGI script.
That
Re:Template Toolkit (Score:1)
Very good point.
I just skip the write-to-disk step. If your process is long-lived enough, then the compile time of the template is trivial. The biggest cost in that case is if you have too many templates to comfortably fit in RAM.
If I understand Template::Provider correctly, then COMPILE_DIR defaults to disabled anyway, so this isn't a problem unless you turn it on.
Reply to This
Parent
Re: (Score:1)
I've found it quite useful to just compile every possible loadable template in advance :)
http://search.cpan.org/~adamk/Template-Provider-Preload-0.05/lib/Template/Provid er/Preload.pm [cpan.org]