Thanks, but remember I warned you in the CB! :)
> It would be nice if Perl's loop-keywords would also recognise an Iterator::* object and would treat it as expected... (internally rewriting it C-style, whatever).
I doubt this can be retro fitted without bracking backwards comaptibility.
You'd need a new keyword, like iter for my goal, this could actually be implemented with pluggable keywords.
Please note that you can already overload the diamond operator of a class to make the object an iterator (like a filehandle does)
This should work:
but letting a generator init an iterator once wouldn't
because the diamond operator magically decides to become a file-glob here.