title: Perl: How to print array of hashes,
body: <p>There don't seem to be a lot of examples of people using arrays containing hashes.
  I want to check the array I am constructing in a sub but I'm having some issues accessing the structure. Perhaps I am not imagining the construct the way it exists. This is an example of some code:</p>
  
  <pre><code>#!/usr/bin/perl
  
  use strict;
  use warnings;
  use Data::Dumper;
  
  
  my (%data, %data2, @holding);
  
  %data = (
      'monday' =&gt; "This stuff!",
      'tuesday' =&gt; "That stuff!!",
      'wed' =&gt; "Some other stuff!!!"
      );
  
  push @holding, %data;
  
  %data2 = (
      'monday' =&gt; "Yet more stuff... :-P ",
      'tuesday' =&gt; "Some totally different stuff!",
      'wed' =&gt; "What stuff is this?"
      );
  
  push @holding, %data2;
  
  foreach my $rows(@holding){
      foreach my $stuff (keys %{$holding[$rows]} ){
          print "$holding[$rows]{$stuff}\n";  
      }
  }
  </code></pre>
  
  <p>The error message I get:</p>
  
  <pre><code>Argument "wed" isn't numeric in array element at /home/kingram/bin/test line 27.
  Can't use string ("wed") as a HASH ref while "strict refs" in use at /home/kingram/bin/test line 27.
  </code></pre>
  
  <p>My work with arrays in perl is not extensive so I'm sure I'm missing something basic.</p>
  
  <p>When I use Dumper I am expecting VAR1 and VAR2 expressing two distinct rows but I get</p>
  
  <pre><code>$ ~/bin/test
  $VAR1 = [
            'wed',
            'Some other stuff!!!',
            'monday',
            'This stuff!',
            'tuesday',
            'That stuff!!',
            'wed',
            'What stuff is this?',
            'monday',
            'Yet more stuff... :-P ',
            'tuesday',
            'Some totally different stuff!'
          ];
  </code></pre>