That doesn't do any autovivification. You meant (note the referencing down a deeper level than the exists test):
if (exists $foo->{bar}){ .. will not run .. } if ($foo->{bar}->{baz}) {...} if (exists $foo->{bar}){ .. will run .. }
if (exists $foo->{bar}){ .. will not run .. } if ($foo->{bar}->{baz}) {...} if (exists $foo->{bar}){ .. will run .. }