> > Harry> [% var1 | eval %] > > Of course, this prevents the caching of the template-to-Perl > translation, so this should be the "avoid at all cost" solution. > Better would be to find a way to push that stuff into a file in the > INCLUDE path to permit it to be treated as normal text. > > Hmm. Template::Plugin::CachedEval, anyone? :)
Just an example of why we can't just put it in a file. We have a number of template libraries for our clients, such as an order page template library. There are a limited number of configuration options that we want to store in template variables, but we dont' want our clients to have to edit template pages directly just for these few variables. So I have a function that stores the variables in a cache(memcache) backed by a database (values frozen with Storable), and the header page thaws them out and sticks them into a template hash. Most clients don't get enough traffic where the performance is an issue, and it if is then it's easy to just stick them directly into the header file on a case by case basis. For 95% of our clients though it's much easier to just have a web page where they enter the configuration variables and not have to worry about editing template pages at all. Chris > > -- > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 > <[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/> > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! > > _______________________________________________ > templates mailing list > [EMAIL PROTECTED] > http://lists.template-toolkit.org/mailman/listinfo/templates > _______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
