in reply to Substr versus Regexp
sub characters_in_common { my ($p, $q) = @_; my $r = $p ^ $q; my $count = $r =~ y/\0//; return $count; } [download]