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/
In reply to Re: Re: Re: comparing strings
by petral
in thread comparing strings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |