title: In Perl, is there a built in way to compare two arrays for equality?
body: <p>I have two arrays of strings that I would like to compare for equality:</p>
  
  <pre><code>my @array1 = ("part1", "part2", "part3", "part4");
  my @array2 = ("part1", "PART2", "part3", "part4");
  </code></pre>
  
  <p>Is there a built-in way to compare arrays like there is for scalars?
  I tried:</p>
  
  <pre><code>if (@array1 == @array2) {...}
  </code></pre>
  
  <p>but it just evaluated each array in scalar context, and so compared the length of each array.</p>
  
  <p>I can roll my own function to do it, but it seems like such a low-level operation that there should be a built-in way to do it.  Is there?</p>
  
  <p>Edit: sadly, I don't have access to 5.10+ or optional components.</p>