in reply to Fastest way to find the mismatch character

$ perl -le' my $varA = "This is the wild cat"; my $varB = "Thsi is the widl cat"; my $temp = $varA ^ $varB; my @fields; unshift @fields, [ $+[0], $-[0] ] while $temp =~ /[^\0]+/g; my $VarC = $varB; for my $offsets ( @fields ) { substr $VarC, $offsets->[0], 0, "</mismatch>"; substr $VarC, $offsets->[1], 0, "<mismatch>"; } print $VarC; ' Th<mismatch>si</mismatch> is the wi<mismatch>dl</mismatch> cat