use strict; use warnings; use Data::Dumper; my %hash; if (exists $hash{foo}{bar}{element}) { print "It exists!\n" } print Dumper(\%hash);