title: How can I reset a hash completely without using a for loop?
body: <p>I would like to completely reset my <code>%hash</code> so that it does not contain keys or values at all. I prefer to use a one-liner than have to use a loop.</p>
  
  <p>So far I have tried:</p>
  
  <pre><code>%hash = 0;
  %hash = undef;
  </code></pre>
  
  <p>But these both throw errors in strict mode with warnings enabled, so I wrote a simple for loop to achieve the same thing:</p>
  
  <pre><code>for (keys %hash) {
      delete $hash{$_};
  }
  </code></pre>
  
  <p>This works but I would really like to do this with a one-liner. Is there a way to simply reset a hash that I am overlooking?</p>