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:...
In reply to Re: Re2: Check for existence in a hash of hashes
by Fletch
in thread Check for existance in a hash of hashes
by Perl_User
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |