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


in reply to Re: Recursively-generated Iterators
in thread Recursively-generated Iterators

You can go a little further and say that this technique will never get you the fastest iterator, but it will likely get you one that is fast and memory-efficient enough, while remaining simple: a sweet spot.

Caution: Contents may have been coded under pressure.