in reply to Replacing letters in one string based on another
$str1 = "ABCXXFGH"; $str2 = "XXCDEFGH";; tr[X][\x00] for $str1, $str2;; ( $str3 = $str1 & $str2 ) =~ tr[\x00][X];; print $str3;; XXCXXFGH [download]