in reply to Should calling 'exists' create a hash key?

A couple of possible code hacks to avoid autovivication in:
print "defined\n" if (exists($x->{fred}->{dave}));
1. Use last to abort the statement (adapted from Re: Shortcut operator for $a->{'b'}=$b if $b;):
{ print "defined\n" if (exists(%{$x->{fred}||last}->{dave})); }

2. Redirect to an anonymous empty hash ref:

print "defined\n" if (exists(%{$x->{fred}||{}}->{dave});