|
|
Choosing A Webhost: |
Bug report: Problems using cache: msg#00014lang.perl.modules.html-template
Hello HTML::Template developers and users, I would like to report a bug regarding cache feature and template objects using the same template file. Here is the Test-Case: * /opt/Perl/Playground/template.tmp ---------------------------------------------------------------------------- <TMPL_VAR NAME="TITLE"> <TMPL_VAR NAME="CONTENT"> ---------------------------------------------------------------------------- * /opt/Perl/Playground/HtmlTmplHandler.tmpl ---------------------------------------------------------------------------- package Playground::HtmlTmplBugHandler; use warnings; use strict; use Apache2::RequestRec (); use HTML::Template (); my $htmlTemplate = '/opt/Perl/Playground/template.tmpl'; sub handler { my $rRequestRec = shift; my $rTmpl1 = HTML::Template->new(filename => $htmlTemplate, cache => 1); my $rTmpl2 = HTML::Template->new(filename => $htmlTemplate, cache => 1); $rTmpl1->param(TITLE => 'Title'); $rTmpl2->param(TITLE => 'Subtitle', CONTENT => 'Content'); $rTmpl1->param(CONTENT => $rTmpl2->output()); # Invalid. Outputs: # Subtitle # Subtitle # Content =begin comment $rTmpl2->param(TITLE => 'Subtitle', CONTENT => 'Content'); $rTmpl1->param(TITLE => 'Title'); $rTmpl1->param(CONTENT => $rTmpl2->output()); # Invalid. Outputs: # Title # Title # Content =cut =begin comment $rTmpl2->param(TITLE => 'Subtitle', CONTENT => 'Content'); $rTmpl1->param(TITLE => 'Title', CONTENT => $rTmpl2->output()); # Correct. Outputs: # Title # Subtitle # Content =cut $rRequestRec->content_type('text/plain'); $rRequestRec->print($rTmpl1->output()); $rRequestRec->rflush(); return Apache2::Const::OK; } 1; ---------------------------------------------------------------------------- * httpd.conf ---------------------------------------------------------------------------- .. <Location /html_template_bug> SetHandler modperl PerlResponseHandler Playground::HtmlTmplBugHandler </Location> .. ---------------------------------------------------------------------------- My configuration: Apache/2.0.54 (Unix) mod_perl/2.0.1 Perl/v5.8.5 HTML::Template v2.7 It seems that there is a global cache for each template file which apparently temporary holds values as well and it doesn't really expect that two or more instances of the same template might be used in the same time. Can anyone help me with this issue? Thank you in advance. Regards, Jozef -- jozef kosoru http://zyzstar.kosoru.com ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: HTML Template - fatal error in loop output, Brad Baxter |
|---|---|
| Next by Date: | Re: HTML::Template bug report: Problems using cache, Sam Tregar |
| Previous by Thread: | HTML Template - fatal error in loop output, Senthil Nathan |
| Next by Thread: | Re: HTML::Template bug report: Problems using cache, Sam Tregar |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |