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


in reply to Return a list or an iterator

You may be interested in Damian's talk, "Sufficiently Advanced Technologies", podcast at http://yapc.g.hatena.ne.jp/jkondo/. He mentions some refinements on this technique, such as returning an object with boolean overloads so that while ($iter) {...} will correctly set $_ on each iteration.
--Dave
Opinions my own; statements of fact may be in error.