I know this is 2 years old but I stumbled on this and it might similarly confuse someone else.
THIS is the corrected bit_test subroutine
sub bit_test { my ($value, $bit) = @_; return $value & (1 << $bit); }
Original code would only test the first bit position (1 << 0).
In reply to Re^2: bitmask check
by Anonymous Monk
in thread bitmask check
by wwe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |