title: how to grep perl Hash Keys in to an array?
body: <p>Iam a perl newbie and need help in understanding the below piece of code.</p>
  
  <p>I have a perl Hash defined like this</p>
  
  <pre><code>1   my %myFavourite = ("Apple"=&gt;"Apple");
  2   my @fruits = ("Apple", "Orange", "Grape");
  3   @myFavourite{@fruits}; # This returns Apple. But how?
  </code></pre>
  
  <p>It would be great if perl gurus could explain what's going on in Line-3 of the above code.
  myFavourite is declared has a hash,but used as an array? And the statement simply takes the key of the hash ,greps it in to the array and returns the hash values corresponding the key searched. Is this the way we grep Hash Keys in to the Array?</p>