title: Return all hash key/value pairs with maximum value
body: <p>I have a hash (in Perl) where the values are all numbers. I need to create another hash that contains all key/value pairs from the first hash where the value is the maximum of all values.</p>
  
  <p>For example, given</p>
  
  <pre><code>my %hash = (
      key1 =&gt; 2,
      key2 =&gt; 6,
      key3 =&gt; 6,
  );
  </code></pre>
  
  <p>I would like to create a new hash containing:</p>
  
  <pre><code>%hash_max = (
      key2 =&gt; 6,
      key3 =&gt; 6,
  );
  </code></pre>
  
  <p>I'm sure there are many ways to do this, but am looking for an elegant solution (and an opportunity to learn!).</p>