title: Test, if a hash key exists and print values of Hash in perl
body: <p>If a key exists in a array, I want to print that key and its values from hash. Here is the code I wrote.</p>
  
  <pre><code>for($i=0;$i&lt;@array.length;$i++)
  {
      if (exists $hash{$array[$i]})
      {
          print OUTPUT $array[$i],"\n";
      }
  }
  </code></pre>
  
  <p>From the above code, I am able to print keys. But I am not sure how to print values of that key.</p>
  
  <p>Can someone help me?</p>
  
  <p>Thanks</p>