title: Iterate through hash values in perl
body: <p>I've got a hash with let's say 20 values.</p>
  
  <p>It's initialized this way:</p>
  
  <pre><code>my $line = $_[0]-&gt;[0];
  
      foreach my $value ($line) {
          print $value;
      }
  </code></pre>
  
  <p>Now when I try to get the value of each hash in $line it says:
  Use of uninitialized value in print at file.pl line 89</p>
  
  <p>Is there a way to iterate through each value of a hash?</p>
  
  <p>I also tried it with:</p>
  
  <pre><code>my %line = $_[0]-&gt;[0];
  
      foreach my $key (keys %line) {
          print %line-&gt;{$key};
      }
  </code></pre>
  
  <p>But that is also not working:
  Reference found where even-sized list expected at file.pl at line 89</p>
  
  <p>Anybody knows what to do? It shouldn't be that difficult...</p>