in reply to Compare two variables
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"; [download]