title: Printing values for hash of arrays in perl
body: <p>I've got a hash of arrays that's declared as follows:</p>
  
  <pre><code>my %hash;
  push @{ $hash{ $value1[$_] } }, [ $value1[$_], $value2[$_], $value3[$_], $value4[$_], $value5[$_] ] for 0 .. $#value1;
  </code></pre>
  
  <p>I want to be able to inspect the values for each key using:</p>
  
  <pre><code>open KEYS, '&gt;keys.txt' or die "Can't write to 'keys.txt'\n";
  
  for my $key ( sort keys %hash ) {
      print KEYS "Key: $key contains the values: ";
      for my $value ( @{$hash{$value1}} ) {
          print KEYS "$value ";
      }   
      print KEYS "\n";
  }
  close(KEYS);
  </code></pre>
  
  <p>While I can visualise the keys and associated values using Data::Dumper, the output from the above code gives memory locations, rather than values, for each key. E.g:</p>
  
  <pre><code>Key: 'Value1' contains the values: ARRAY(0x7fcd8645ba68) 
  </code></pre>
  
  <p>Even though I'm pushing the same number of values onto each array, each key contains different numbers of values</p>
  
  <p>Is there something wrong with the way I'm going about this? </p>