Mutate the Ns first:
use strict; use warnings; use Data::Dumper; my $s1 = "STCATTNNNSATCGCT"; my $s2 = "ATCGTCGSNNNNATCG"; $s1 =~ tr/N/n/; my $merge = $s1 ^ $s2; my $count = $merge =~ tr/\0//; print $count;
Prints:
4
In reply to Re: Conditional Bitwise XOR(^) Operator in Matching Chars Count of Two Strings
by GrandFather
in thread Conditional Bitwise XOR(^) Operator in Matching Chars Count of Two Strings?
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |