my %hash = ( Key1 => { john => 1, pete => 2 }, Key2 => { frank => 3, howard => 4 } ); print "Exists!\n" if defined $hash{Key7}{ted}; print "Key7 exists!\n" if exists $hash{Key7};