title: How can I compare different elements of array in Perl?
body: <p>I am new to this field. So kindly go easy on me. I have two arrays:</p>
  
  <pre><code>@array1 = ("ABC321", "CDB672", "PLE89",....);
  
  @array2 = ("PLE89", "ABC678", "LMD789",...);
  </code></pre>
  
  <p>I want to compare elements of these two different arrays. But, I want to only match letters with letters. So for instance, if arrays are compared, <code>$array[2]</code> element (PLE) should match with <code>$array2[0]</code> (PLE) and similarly <code>$array1[0]</code> (ABC) should match with <code>$array[1]</code> (ABC). I am able to do it one at time but not able to compare all elements of both array at the same time (that is looping the arrays).</p>
  
  <pre><code>    my ($value1)= ($array[2]=~ /([A-Z]+)[0-9]+/);
      print "Value1: $value1 \n";
      my ($value2)= ($array[0]=~ /([A-Z]+)[0-9]+/);
      print "Value2 : $value2 \n";
      if ($value1 eq $value2){
              print " length \n";
      }
  </code></pre>
  
  <p>Any suggestions on how to do I set up loop for both arrays at the same time?</p>