in reply to Re2: Check for existence in a hash of hashes
in thread Check for existance in a hash of hashes

You've created $a{bar} by your second check, just as perldoc -f exists explains.

Although the deepest nested array or hash will not spring into existence just because its existence was tested, any intervening ones will. Thus "$ref->{"A"}" and "$ref->{"A"}->{"B"}" will spring into existence due to the existence test for the $key element above. This happens anywhere the arrow operator is used, including even:...

Replies are listed 'Best First'.
Re4: Check for existence in a hash of hashes
by dragonchild (Archbishop) on Mar 27, 2002 at 18:57 UTC
    I know that. You know that. Did the original poster know that? Did all the readers of this thread know that?

    When you post a solution, you should post the common caveats, gimmes, and gotchas as well. Otherwise, those who may not be as fluent as the saints will get frustrated.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.