* Erik Price <[EMAIL PROTECTED]> [2002-11-21 22:37]:
> On Sunday, December 8, 2002, at 11:56 PM, Komtanoo Pinpimai wrote:
>
> > you see? It is not elegant.. has perl this iterator variable ?
>
> Man! And I thought one of the nice things about Perl was you didn't
> have to use an Iterator to traverse a List!
The cool thing about Perl is that you can use it to implement first
class iterators in your mini-languages:
[% FOREACH num = [ 1 2 3 4 ] %]
* [% num %] ([% loop.count %] of [% loop.size %])
[% END %]
In this example, using Template Toolkit, I<loop> is the iterator.
(darren)
--
Think like a man of action, act like a man of thought.
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm