in reply to Re: Hashes: Deleting elements while iterating
in thread Hashes: Deleting elements while iterating
Yes, that approach worked for me as well. It's when I use
that I get the errors.foreach $key (%index){
If you look closely in the code I posted there are 3 loops above the delete operation, 2 of which are commented out. The ones commented out work, the other does not. I just change which one is UNcommented to test a particular way of doing it. I suppose this may seem unorthodox but it's just my way of trying to learn the differences/nuances of perl...
So, what's the problem you might ask? ;-)
Just seeking enlightenment as to why the one method gets errors (at least for me).
Thanks for testing it out for me.
|
|---|