in reply to Comparing arrays with text contents
Your,
puts exactly one element in each array, a reference to the corresponding array. They will never match unless you compare an array to itself.@arr1=sort($_[0]); @arr2=sort($_[1]);
You want,
my @arr1 = sort @{$_[0]}; my @arr2 = sort @{$_[1]};
Your for loop is more perlishly written,
but what you have will work fine.for (0 .. $#arr1) { if ($arr2[$_] ne $arr1[$_]) { print "Anchor/indicator mismatch in $arr1[$_]\n"; } }
You might be interested in the Algorithm::Diff package.
After Compline,
Zaxo
|
|---|