Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 rifling through the Monastery: (6)
As of 2016-06-28 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (350 votes). Check out past polls.