in reply to How can I delete a key' value from a hash

Isn't this the classic "operating on a {data structure} inside a loop that iterates through the elements of that {data structure}" problem?

How do you know it's not working? Are you checking after the loop finishes? Are you sure the loop is iterating over everything you think it is?

In other words, where is the code you are using that verifies that the code is indeed not doing what you want?

UPDATE: While I'd still like to know the answers to the questions above, I like GrandFather's tack better. I was not aware of/thinking about the autovivification issue. I had assumed that you originally tried the first delete only, and subsequently added the other delete statements as debugging tools.

In any case, I think it would give monks a better chance to help if you showed more of your code and/or exlained your procedures better. And I don't mean to imply anything with the above questions; I really am wondering.


I like computer programming because it's like Legos for the mind.
  • Comment on Re: How can I delete a key' value from a hash

Replies are listed 'Best First'.
Re^2: How can I delete a key' value from a hash
by kevyt (Scribe) on Jan 07, 2007 at 23:48 UTC
    Thanks for your help.