in reply to Why is this not autovivifying?
In your case, you would want Perl to create the element 'foo' so that it would exist in the structure of the object, but that would be detrimental in many cases, and make it difficult to check the structure of objects if every element was created when you looked at it.$thingy{'someElement'}++; # vivifies it to '0' before you increment it to '1' $thingy{'someElement'} .= "Foo!"; # vivifies it to the empty string... $thingy{'someElement'}{'otherElement'} = "Foo!"; # vivifies someElement to a hash reference
|
|---|