in reply to Array compare not matching all elements

It is often worth the effort to look for a module even to do simple tasks. In this case consider the function 'intersect' in the module Array::Utils. An added benefit is that although your spec 'compare value of 2 arrays' is ambiguous, the word 'intersect' is not. It says exactly what you mean.
$type Dnamonk3.pl use strict; use warnings; use Array::Utils qw(intersect); my @array1 = ("A2","A5","C1","G0","T3","T4"); my @array2 = ("A2","A3","A5","G1","G0","G4"); { local $, = ','; print intersect(@array1, @array2); } $perl Dnamonk3.pl A2,A5,G0
Bill