I have been using the Template Toolkit for a while now and have come across some issues. I was wondering if anyone else had similar experiences, and if there is anything to be done about them aside from contacting the Module's authors.
The application I am working uses the toolkit to, among other things, format a list of records pulled from a database. The dilemma is that with caching enabled (the default state) when the number of entries pulled from the database varies, the change is not reflected in the resulting output. This was confusing, as I'd expect caching to only affect the template itself, and that the placeholders in the templates would be populated anew each time. I tried to enable template compiling with similar results.
As an aside on this journey, for some reason my templates only get re-processed when I change the source code file calling the template. It does not seem to check if the original template file has changed (this is for caching. I did not check for compiling).
Continuing on, while I wanted very much to use caching, I decided that I should try to disable caching to see if the updates to the database would then be reflected in the templates. so i dutifully said:
my $template = Template->new({INCLUDE_PATH => 'e:/web_projects/marksphotos/templates/',DELIMITER=>';',CACHE_SIZE=>0});To which I got the less than gratifying response:
Undefined subroutine &Template::Service::confess called at c:/Perl/site/lib/Template/Service.pm line 183.I was running toolkit v2.0. I checked the website and found that 2.02 was out. I dutifully downloaded and installed the upgrade, and tried again, with the disabled cache. Now I get:
Not a GLOB reference at c:/Perl/site/lib/Template/Provider.pm line 506.Is anyone aware of anything like this, or should I take it up with the Module authors? I will post source if requested. FYI, I am using ActiveState Build 616 on Win32. This is a 5.6.0 build.
In reply to Template Toolkit and Caching by AidanLee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |