http://www.perlmonks.org?node_id=970004


in reply to Re^3: Is it possible to find the number of matching and non-matching positions in strings using perl code?
in thread Is it possible to find the number of matching and non-matching positions in strings using perl code?

It adds generality beyond three strings to compare.

I might give you that if you wrote it that way. for ($b, $c) isn't any more general than my single statement. We'd both have to go change our code if we suddenly had to compare 4 strings.

So what do you suggest instead? Your usage of $bits isn't any better, because you don't care about bits, but bytes.

I'm not suggesting it's a good name for anything more than a throwaway example, but I wouldn't say it isn't any better. I do actually care about bits as I'm using it with bitwise operators. And the real point is that calling it $mask implies that you intend to use it as a mask. When you don't, confusion results.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re^4: Is it possible to find the number of matching and non-matching positions in strings using perl code?
  • Select or Download Code