In this original question (see below), you try to use a WHILE loop on a list. That's not what while loops are for ... they are for looping for an indefinite amount of time. Use FOREACH instead:
[% avar = [0,1,2] %][% FOREACH bvar = avar %][% bvar %][% END %] In later replies, we see that you are actually trying to use an iterator. Please consult with Template::Iterator before you try to reinvent that wheel, and please ask the real question the first time, instead of waiting for correct but unacceptable answers to let us know what's really going on. jeffa --- Aleksandr Guidrevitch <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm new to the mailing list. I have a question about wrong WHILE behaviour > (this is a minimal snippet to reproduce): > [% avar = [0,1,2] %][% WHILE (bvar = avar.shift) %][% bvar %][% END %] > > It doesn't print nothing... Since fixing Directives.pm and Stash.pm > to recognize undef breaks some tests from test suite, I expect this is > a known bug/feature. > > Is there any elegant workaround ? > > Sincerely, > Alex > > > > > > _______________________________________________ > templates mailing list > [EMAIL PROTECTED] > http://lists.template-toolkit.org/mailman/listinfo/templates __________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html _______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
