The & prototype was the secret sauce!
Actually, I think wantarray is the secret sauce as it allows the iterator function to discriminate list vs. scalar context. :)
Give a man a fish: <%-{-{-{-<
In reply to Re^3: How can I create an iterator that works inside foreach() (updated)
by AnomalousMonk
in thread How can I create an iterator that works inside foreach()
by PUCKERING
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |