# there are probably better ways of doing a string diff... my ($s1, $s2) = ($title_checking, $titlenamefromindex); for (my $i = 0; i < length( $s1); $i++) { print "Different at $i\n" if (substr( $s1, $i, 1) ne substr( $s2, $i, 1); }