http://www.perlmonks.org?node_id=451299


in reply to How To: Make An Iterator

A quibble on terms: what you call a "reusable iterator" is a "factory". A reusable iterator would be one that resets itself after returning the "list is exhausted" value. Array iterator factory is an example of a factory that generates reusable iterators.

Caution: Contents may have been coded under pressure.