Help for this page

Select Code to Download


  1. or download this
    $counter=@dna;$counter2=@comp;
    
  2. or download this
    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