in reply to Re: Re: comparing strings
in thread comparing strings
The following will replace the non-matching chars in the string  $str1 with "*" (and leave the matching chars) by converting $str2 to a regex:if ($lines{$_] eq $lines2[$_]) {
$str2 =~ s/./(?:($&)|.)/g; print map{$_||'*'} $str1 =~ /$str2/
|
---|