use strict; use Tie::Hash::FixedKeys; my %a : FixedKeys( qw(a b) ); %a = (a => 1, b=> 2); print "Doesn't exist\n" unless exists($a{c}); print "Also Doesn't exist\n" unless exists($a{c}->{d}); print "Oh, my, not good\n" if exists($a{c});