Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: bitwise AND against a variable containing Fnctl constants not returning desired results

by RichardK (Parson)
on Jun 05, 2014 at 22:32 UTC ( #1088940=note: print w/ replies, xml ) Need Help??


in reply to bitwise AND against a variable containing Fnctl constants not returning desired results

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

Comment on Re: bitwise AND against a variable containing Fnctl constants not returning desired results
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1088940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2016-05-25 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?