title: How to get first n key-value pairs from a hash table in Perl
body: <p>I'm very new to perl so I searched for some time but still get the answer. I want to get first 100 pairs from a hash table but don't know how to do that. To get each pair from a hash table, we can do something like:</p>
  
  <pre><code>foreach my $term (keys %hashtable)
  {
      do something regarding $hashtable{$term} here
  }
  </code></pre>
  
  <p>But how to get first 100 pairs out of it? Thanks a lot!</p>