in reply to Tell whether two strings differ at only one position
sub compare { (my $xor=$_[0]^$_[1]) =~ tr/\0//d; length $xor < 2; } [download]