my $str1 = "The device doesn't allow writes and that's causing this issue."; my $str2 = "The device allow writes and that's causing this issue."; my $str3 = $str1 ^ $str2; print "Difference found at $+[0]\n" if $str3 =~ /^(\0+)/;