If you are suffering from the undef is a value problem¹, than call iterators in list context. Re: list context (iterators).
I have to admit that I didn't try to understand your code , though! :)
¹) aka "0 but true" nonsense
In reply to Re^2: An iterator for (not "iterating") a recursive data structure.
by LanX
in thread An iterator for (not "iterating") a recursive data structure.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |