in reply to deleting a hash key can create one?

Autovivification (or autovivication in some peoples lexicon) is a pretty well known feature of Perl. But we all walk slap bang into it at some time!

In the very same thread that Roger referred you to their is a nifty little subroutine ( Re: Autovivification with hash of hashes ) that you can use to test for existence without autovivifying the shallower levels of the hash. You will also find here a discussion of the subject and some more code that is related to the problem.

The subject is covered in detail in Programming Perl 3rd edition on page 254.

jdtoronto

  • Comment on Re: deleting a hash key can create one?