title: Find size of an array in Perl
body: <p>I seem to have come across several different ways to find the size of an array. What is the difference between these three methods?</p>
  
  <pre><code>my @arr = (2);
  print scalar @arr; # First way to print array size
  
  print $#arr; # Second way to print array size
  
  my $arrSize = @arr;
  print $arrSize; # Third way to print array size
  </code></pre>