Subject: | WHILE_MAX setting does not seem to work |
Date: | Thu, 11 Feb 2010 13:58:04 -0800 |
To: | bug-Template-Toolkit [...] rt.cpan.org |
From: | kavi <kavi [...] saralweb.com> |
platform (uname -a )
------------------------------------
Linux kavi-hp 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC
2009 x86_64 GNU/Linux
template toolkit version
---------------------------------------
tpage 2.7 (Template Toolkit version 2.22)
tpage command
---------------------------
tpage --load_perl testfile
contents of testfile
-------------------------------
[% USE Template.Directive %]
[% Template.Directive.WHILE_MAX = 1000000 %]
[% counter = 0 %]
[% WHILE counter < 10000 %]
[% counter = counter + 1 %]
counter = [% counter %]
[% END %]
error message / crash
---------------------------------------
undef error - WHILE loop terminated (> 1000 iterations)
Further narrative
-----------------------------
I can't get WHILE_MAX setting to work. My actual code is a perl module
which calls process() on a template object created via new() method on
Template. In my code I am doing :
use Template::Directive;
$Template::Directive::WHILE_MAX=1000000
but that code also crashes with the same message.
I have managed to reproduce the probem with a simple template fragment
pasted above.
You can check the value of WHILE_MAX also as below (you must comment out
the while loop or else it crashes anyway).
[% USE Template.Directive %]
[% Template.Directive.WHILE_MAX = 1000000 %]
while max is [% Template.Directive.WHILE_MAX %]
[% counter = 0 %]
[%# WHILE counter < 10000 %]
[% counter = counter + 1 %]
counter = [% counter %]
[%# END %]
I have the same problem whether Stash is enabled or not...
thx - kavi
Show quoted text
_____________________________________________________________________
List your Business on http://www.saralweb.com/findex.pl for FREE and generate sales inquiries.