![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^4: Is it safe to append to the array you are iterating overby DrWhy (Chaplain) |
on Mar 14, 2013 at 19:23 UTC ( [id://1023538]=note: print w/replies, xml ) | Need Help?? |
I disagree with your 'for no good reason' part. In my use case, I have a very good reason to want this to happen. (I mean the real code I'm working on, not the baby example I used in the OP). I'm using it to traverse a tree of nodes and build a list (actually a hash) of data about the nodes.
But as I said in another comment, I'm switching to using an implementation that uses a while loop instead that's clearly safer. --DrWhy "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
In Section
Seekers of Perl Wisdom
|
|