Excerpt from:

http://www.template-toolkit.org/docs/plain/Manual/Directives.html

<...>
However, under normal operation, the loop variable remains in scope
after the FOREACH loop has ended (caveat: overwriting any variable
previously in scope). This is useful as the loop variable is secretly an
iterator object (see below) and can be used to analyse the last entry
processed by the loop.
<...>

No details could be seen anywhere "below" however and the above text is
a bit confusing, IMHO. It obviously refers to the variable holding an
iterator object inside a loop, not to the "loop" virtual variable
itself. Perhaps I was reading this too late in the night...

Cheers,
Ivan

On 14 Sep 2003 20:50:56 -0700
[EMAIL PROTECTED] (Randal L. Schwartz) wrote:

> >>>>> "Ivan" == Ivan Adzhubey <[EMAIL PROTECTED]> writes:
> 
> Ivan> E.g. looks like loop variable is out of scope outside FOREACH
> body, but Ivan> it shouldn't, according to docs. Have I missed
> something?
> 
> What part of the docs suggest that "loop" is valid outside the loop?
> I've never interpreted it that way.
> 
> -- 
> 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


-- 
Ivan Adzhubey

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to