title: Perl array vs list
body: <p>I have two data structures in Perl:</p>
  
  <p>An array:</p>
  
  <pre><code>my @array2 = ( "1", "2", "3");
  
  for $elem (@array2) {
      print $elem."\n";
  }
  </code></pre>
  
  <p>Giving me the following output:</p>
  
  <pre><code>1
  2
  3
  </code></pre>
  
  <p>And a list:</p>
  
  <pre><code>my @array = [ "1", "2", "3"];                                            
  
  for $elem (@array) {
      print $elem."\n";
  }
  </code></pre>
  
  <p>Giving the following output:</p>
  
  <pre><code>ARRAY(0x9c90818)
  </code></pre>
  
  <p>Obviously, I'd like to iterate over the elements in both cases, but why does the second solution give me only the reference to this array?</p>