use strict; use warnings; use Data::Dumper; my %hash; if (exists $hash{foo}{bar}{element}) { print "It exists!\n" } print Dumper(\%hash); #### $VAR1 = { 'foo' => { 'bar' => {} } }; #### use strict; use warnings; use Data::Dumper; no autovivification; # disables types of autovivification which are typically not intended my %hash; if (exists $hash{foo}{bar}{element}) { print "It exists!\n" } print Dumper(\%hash); #### $VAR1 = {};