title: Perl, dereference array of references
body: <p>In the following Perl code, I would expect to be referencing an array reference inside an array</p>
  
  <pre><code>#!/usr/bin/perl
  
  use strict;
  use warnings;
  
  my @a=([1,2],[3,4]);
  
  my @b = @$a[0];
  
  print $b[0];
  </code></pre>
  
  <p>However it doesn't seem to work. I would expect it to output 1.</p>
  
  <p><code>@a</code> is an array of references</p>
  
  <p><code>@b</code> is <code>$a[1]</code> dereferenced (I think)</p>
  
  <p>So what's the problem?</p>