title: Why does an empty Perl hash have one key?
body: <p>The standard googleable answer to "How do I find out the size of a hash in Perl?" is "take the size of <code>keys(%hash)</code>":</p>
  
  <pre><code>my %h = {};
  print scalar (keys (%h));
  </code></pre>
  
  <p>This prints '1'. I was expecting zero. On the other hand. Similarly,</p>
  
  <pre><code>my %h = {};
  $h{"a"} = "b";
  $h{"x"} = "y";
  print scalar keys (%h);
  print "\nKey: $_" for (keys %h);
  </code></pre>
  
  <p>Prints:</p>
  
  <blockquote>
    <p>3</p>
    
    <p>Key: a</p>
    
    <p>Key: x</p>
    
    <p>Key: HASH(0x229e8)</p>
  </blockquote>
  
  <p>Where has this extra value come from?</p>