Keep It Simple, Stupid | |
PerlMonks |
Re: Ouch! Each! Reentrant it is notby Zaxo (Archbishop) |
on Jul 15, 2005 at 02:51 UTC ( [id://475109]=note: print w/replies, xml ) | Need Help?? |
That's a nice demonstration of remembered state with each. It can be a useful property to exploit for some kinds of iterators, but it's pretty fragile. As you say, calling keys on the hash resets the each state. You can avoid the scalar op and a useless variable by just calling keys in scalar context:
After Compline,
In Section
Meditations
|
|