title: Perl: Matching hash keys to a regular expression
body: <p>I'm wondering if Perl has a built-in way to check for the existence of a hash element with a key matching a particular regex. For example:</p>
  
  <pre><code>my %h = ( 'twelve' =&gt; 12, 'thirteen' =&gt; 13, 'fourteen' =&gt; 14 );
  </code></pre>
  
  <p>I'm wondering if there is any way to do this:</p>
  
  <pre><code>print "We have 12\n" if exists $h{twelve};
  print "We have some teens\n" if exists $h{/.*teen$/};
  </code></pre>