title: Sort Perl hash from largest to smallest
body: <p>I am looking at an example found here: <a href="http://perlmeme.org/tutorials/sort_function.html" rel="nofollow">http://perlmeme.org/tutorials/sort_function.html</a></p>
  
  <p>And it gives this code to sort a hash based on each key's value:</p>
  
  <pre><code># Using &lt;=&gt; instead of cmp because of the numbers
      foreach my $fruit (sort {$data{$a} &lt;=&gt; $data{$b}} keys %data) {
          print $fruit . ": " . $data{$fruit} . "\n";
      }
  </code></pre>
  
  <p>This code I do not fully understand, but when I experiment with it, it sorts from lowest to highest. How can I flip it to sort from highest to lowest?</p>