Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2017-05-01 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (544 votes). Check out past polls.