in reply to Turning a recursive function into an iterator
For Perl, it is very easy to convert recursive program into its iterator version.
The only thing you need, in order to accomplish this conversion easily, is 'stack'. Perl by default suppots stack in its core, thanks to the ability to pop() and push() against a list.
To convert:
|
|---|