$counter=@dna;$counter2=@comp; #### my $dna; # the sequence, as a string my $comp; # the complement, as a string my $c2; ($c2=$comp)=~tr[ATGC][TACG]; # copy $comp into $c2, then exchange each base in $c2 with its complement (using the tr-ansliteration operator) print "Match!\n" if $dna eq $c2; # since $c2 is $comp's complement, it should be equal to $dna