http://qs321.pair.com?node_id=209175


in reply to Re: Re: comparing strings
in thread comparing strings

Of course, if you're using arrays, you just need
if ($lines{$_] eq $lines2[$_]) {
The following will replace the non-matching chars in the string  $str1 with "*" (and leave the matching chars) by converting $str2 to a regex:
$str2 =~ s/./(?:($&)|.)/g; print map{$_||'*'} $str1 =~ /$str2/


  p