title: Adding a hash to an array
body: <p>I have an array like so,</p>
  
  <pre><code>@switch_ports = ()
  </code></pre>
  
  <p>and then want to add 50 instances of this hash, to the switch_ports array</p>
  
  <pre><code>%port = (data1 =&gt; 0, data2 =&gt; 0, changed =&gt; 0)
  </code></pre>
  
  <p>however, if I push my hash to the array</p>
  
  <pre><code>push(@switch_ports, %port)
  </code></pre>
  
  <p>but if I do print @switch_ports
  I just see</p>
  
  <pre><code>data10data20changed0
  </code></pre>
  
  <p>so it just seems to be added them to the array, (joining them)
  and if I try and loop the array and print the keys, it also fails.</p>
  
  <p>I think i am going retarded from smashed my head into the desk so hard.</p>
  
  <p>1 - Can you store a hash in an array?</p>
  
  <p>2 - Can you have an array of hashes?</p>
  
  <p>Trying to get...</p>
  
  <pre><code>switchports
      0
          data1
          data2
          changed
      1
          data1
          ....
  </code></pre>
  
  <p>thus</p>
  
  <pre><code>foreach $port (@switchport) {
      print $port['data1']
  }
  </code></pre>
  
  <p>would return all of the data1 for all of the hashes in the array.</p>
  
  <p>Yes, I fail at Perl</p>