in reply to need help comparing DNA compliments

How about having a hash of proper pairs let it have the name %pairs? And than comparing a concatenation of the letters from the first and second string like this
for my $i (0 .. $#dna){ if(! exists $pairs{$dna[$i].$comp[$i]}){ print "mismatch: ...."; } }
Disclaimer: I don't anderstand your code - but from your description I think it is what you wanted.