bitwise & has a lower precedence that == , so perl thinks your code is this
return unless $ds[2] & ( $mask == $mask)try adding more brackets to get it do do what you want.
return unless ($ds[2] & $mask) == $mask;There is a table of operators in precedence order in perlop
In reply to Re: bitwise AND against a variable containing Fnctl constants not returning desired results
by RichardK
in thread bitwise AND against a variable containing Fnctl constants not returning desired results
by theillien1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |