title: Finding multidimensional array size
body: <p>What is the difference when you use <code>()</code> in Perl versus <code>[]</code> for example and how do you find the size of the array when it uses the square brackets?</p>
  <pre><code>my @myarr = ( # Parenthesis
                  [ &quot;itemone&quot;, &quot;itemoneb&quot;, &quot;itemonec&quot; ],
                  [ &quot;itemtwo&quot;, &quot;itemtwob&quot;, &quot;itemtwoc&quot; ]
                 );
  
  my @myarr = [ # Square bracket
                  [ &quot;itemone&quot;, &quot;itemoneb&quot;, &quot;itemonec&quot; ],
                  [ &quot;itemtwo&quot;, &quot;itemtwob&quot;, &quot;itemtwoc&quot; ]
                 ];
  </code></pre>
  <hr/>
  <p>Thank you for the explanations. I am still trying to understand this, and it's just slightly confusing to me at the moment. I still can't figure out how to iterate through my data here:</p>
  <pre><code>#!/usr/bin/perl -w
  
  use strict;
  use FindBin qw($Bin);
  use Cwd;
  use Data::Dumper;
  
  my @mynames = (
                  [ &quot;myname&quot;, &quot;mydescription&quot;, &quot;mydata&quot;],
                  [ &quot;myname2&quot;, &quot;mydescription2&quot;, &quot;mydata2&quot;],
                  [ &quot;myname3&quot;, &quot;mydescription3&quot;, &quot;mydata3&quot;],
                 );
  
  
  go();
  
  sub go {
      start(\@mynames);
  }
  
  sub start {
      my @input_name = shift;
  
      # This works
      #print @input_name-&gt;[0][0][0];
      #die;
  
      # This Shows
      #print Dumper(@input_name);
      #$VAR1 = [
      #          [
      #            'myname',
      #            'mydescription',
      #            'mydata'
      #          ],
      #          [
      #            'myname2',
      #            'mydescription2',
      #            'mydata2'
      #          ],
      #          [
      #            'myname3',
      #            'mydescription3',
      #            'mydata3'
      #          ]
      #        ];
  
      # How do I iterate?
      #for my $i (0..@$input_name) {
      #    my $name = &quot;&quot;;
      #    my $description = &quot;&quot;;
      #    my $data = &quot;&quot;;
      #
      #}
  }
  </code></pre>