in reply to Help comparing data in byte by shifting (>>) bits

Whoever told you that would work is misinformed. && is a binary opertor - it requires operands on both sides. Sticking it on the right side of a >> isn't going to get you anywhere.

Can you explain what you really want to do? Comparing the data in "one byte" is usally done just by comparing characters (since, aside from utf8, characters in Perl are one byte long). If you want extract a single bit from a byte you'll usually use & (not &&) and a bitmask (eg. 0b00000001 to get the first bit).

-sam

  • Comment on Re: Help comparing data in byte by shifting (>>) bits