In the spirit of TIMTOWTDI, here is another approach:
my $s1 = "AYGTACTAGACTACAGACTACAGACATCTACAGACTCATCAGCAGCATATTTA"; my $s2 = "ACGTACTAGACTACAGACTACAGACATCTACAGACTCATCAGCAGCATATTKA"; my $s1_ = $s1; $s1_ =~ tr/ACGT/\0/c; my $s2_ = $s2; $s2_ =~ tr/ACGT/\0/c; my $merged = $s1 ^ $s1_ ^ $s2 ^ $s2_ | $s1_ & $s2_; say $merged; # AYGTACTAGACTACAGACTACAGACATCTACAGACTCATCAGCAGCATATTK +A
In reply to Re: merging dna sequences
by Eliya
in thread merging dna sequences
by garyboyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |