title: How can I sort a Perl hash on values and order the keys correspondingly (in two arrays maybe)?
body: <p>In Perl, I want to sort the keys of a hash by value, numerically:</p>
  <pre><code>{
    five =&gt; 5
    ten =&gt; 10
    one =&gt; 1
    four =&gt; 4
  }
  </code></pre>
  <p>producing two arrays:</p>
  <pre><code>(1,4,5,10) and (one, four, five, ten)
  </code></pre>
  <p>And then I want to normalize the values array such that the numbers are sequential:</p>
  <pre><code>(1,2,3,4)
  </code></pre>
  <p>How do I do this?</p>