title: Enumerate array of hash with Perl
body: <p>I've already spent 2h trying different solution involving hash and array but I didn't find how to iterate through my array of hash: </p>
  
  <p>I created an array like this:</p>
  
  <pre><code>my @matches;
  push @matches, {file =&gt; $1, function =&gt; $2} while m/KEY_FILE \s* \{ [^\}]+ KEY_SECTION \s* \( \s* ([^()]+) \( ([^()]+) \) \s* \)/ixg;
  my $count = @matches;
  </code></pre>
  
  <p>And I want to do something like this: </p>
  
  <pre><code>while (($file, $function) = shift(@matches)) {
      print "// File:     $file\n";
      print "// Function: $function\n";
  }      
  </code></pre>
  
  <p>But obviously this is not a solution :(</p>
  
  <p>Any help ?</p>