in reply to Comparing arrays with text contents

Your,

@arr1=sort($_[0]); @arr2=sort($_[1]);
puts exactly one element in each array, a reference to the corresponding array. They will never match unless you compare an array to itself.

You want,

my @arr1 = sort @{$_[0]}; my @arr2 = sort @{$_[1]};

Your for loop is more perlishly written,

for (0 .. $#arr1) { if ($arr2[$_] ne $arr1[$_]) { print "Anchor/indicator mismatch in $arr1[$_]\n"; } }
but what you have will work fine.

You might be interested in the Algorithm::Diff package.

After Compline,
Zaxo