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: ....";
}
}