Use the XOR!
my $x = "EKFCNSVVDLYSNLSKPFLDIVLYIFKLTSAIGAQGPA----SMMAYLVV"; my $y = "ERFCRQLSSMASKLI-------ISPFTLVYYTYQCFQSTGWPVSIFGYFI"; my $z = $x^$y; my $score = ($z =~ tr/\0//); return $score/length($x)
In reply to Re: Similarity of strings
by ariels
in thread Similarity of strings
by professa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |