title: How can I initialize a 2D array in Perl?
body: <p>How do I initialize a 2D array in Perl?</p>
  
  <p>I am trying the following code:</p>
  
  <pre><code> 0 use strict;
  10 my @frame_events = (((1) x 10), ((1) x 10));
  20 print "$frame_events[1][1]\n";
  </code></pre>
  
  <p>but it gives the following error:</p>
  
  <blockquote>
    <p>Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./dyn_pf.pl line 20.</p>
  </blockquote>
  
  <p>This syntax only seems to initialize a 1D array as print "$frame_events[1]\n" works. Though Perl doesn't give any error during the assignment.</p>