title: How can I sort a hash of hashes by key in Perl?
body: <p>I want to sort a hash which actually has a hash as a value.  For instance:</p>
  
  <pre><code>my %hash1=(
     field1=&gt;"",
     field2=&gt;"",
     count=&gt;0,
  );
  my %hash2;
  $hash2{"asd"}={%hash1};
  </code></pre>
  
  <p>and I inserted lots of hashes to <code>%hash2</code> with different count values of <code>%hash2</code>.</p>
  
  <p>How can I sort the <code>%hash1</code> according to a count value of <code>hash1</code>?</p>
  
  <p>Is there a way of doing this without implementing quicksort manually, for instance with the sort function of Perl?</p>