use strict; use warnings; use Data::Dumper; my %hash; print "key foo->bar exists\n" if exists $hash{foo}{bar}; print Dumper(\%hash);