title: How can I check if a key exists in a deep Perl hash?
body: <p>If I <a href="http://perldoc.perl.org/functions/exists.html" rel="noreferrer">understand correctly</a>,  calling <code>if (exists $ref-&gt;{A}-&gt;{B}-&gt;{$key})  { ... }</code> will spring into existence <code>$ref-&gt;{A}</code> and <code>$ref-&gt;{A}-&gt;{B}</code> even if they did not exist prior to the <code>if</code>!</p>
  
  <p>This seems highly unwanted. So how should I check if a "deep" hash key exists?</p>