Untested. And not benchmarked. But that would be my first try at doing what you need.sub compare { (my $xor=$_[0]^$_[1]) =~ tr/\0//d; length $xor < 2; }
In reply to Re: Tell whether two strings differ at only one position
by blazar
in thread Tell whether two strings differ at only one position
by rg0now
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |