title: How can I get a only part of a hash in Perl?
body: <p>Is there a way to get a sub-hash? Do I need to use a hash slice?</p>
  
  <p>For example:</p>
  
  <pre><code>%hash = ( a =&gt; 1, b =&gt; 2, c =&gt; 3 );
  </code></pre>
  
  <p>I want only</p>
  
  <pre><code>%hash = ( a =&gt; 1, b =&gt; 2 );
  </code></pre>