This is using perl 5.6.1 so Object calls in Perl 5.8 may be faster but not much.
Anyway the iterator is very easy to use, and means I can change underlying data structures and the iterator just works.
This means my current web project (a resteraunt and entertainment search engine) uses two patterns - SQL Phrasebook and Iterators. I wonder how many more I can get in.
Template::Iterator (Score:1)
If you are only using these iterator objects within TT, take a look at
Template::Iterator-- every FOREACH and FOR loop within a template is already implemented using an Iterator (that's theloopspecial variable). This iterator class is trivially modifiable to work outside of TT, as well, if you want to go that way.(darren)