But the for loop just obfuscates things without adding anything at all.
It adds generality beyond three strings to compare.
Also, calling your variable $mask is questionable as you don't really intend to use it as a mask.
So what do you suggest instead? Your usage of $bits isn't any better, because you don't care about bits, but bytes. But $bytes also wouldn't explain the purpose of the variable.
In reply to Re^3: Is it possible to find the number of matching and non-matching positions in strings using perl code?
by moritz
in thread Is it possible to find the number of matching and non-matching positions in strings using perl code?
by supriyoch_2008
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |