Simple way to count matching characters in two strings (assuming they are same size)
$l = length($string1); while ($l--) { $i += 1 if (substr($string1, $l, 1) eq substr($string2, $l, 1)) } print "$i identities.\n";
In reply to Re: Compare two variables
by GotToBTru
in thread Compare two variables
by dmunoze
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |