in reply to I want to write a method that can be used with 'while ($thing = getNextThing() )'

What you need is an iterator. I recommend you read the chapter on iterators in Higher Order Perl.
  • Comment on Re: I want to write a method that can be used with 'while ($thing = getNextThing() )'

Replies are listed 'Best First'.
Re^2: I want to write a method that can be used with 'while ($thing = getNextThing() )'
by Cody Fendant (Hermit) on Aug 20, 2016 at 11:51 UTC

    Thanks! I've hacked something together but I'll read it now.