title: Perl equivalent to Php foreach loop
body: <p>I am looking for a Perl equivalent to the following php code:- </p>
  
  <pre><code>foreach($array as $key =&gt; $value){
  ...
  }
  </code></pre>
  
  <p>I know I can do a foreach loop like so:-</p>
  
  <pre><code>foreach my $array_value (@array){
  ..
  }
  </code></pre>
  
  <p>Which will enable me to do things with the array values - but I would like to use the keys as well.</p>
  
  <p>I know there is a Perl hash which allows you to set up key-value pairs, but I just want the index number that the array automatically gives you.</p>