Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by Old_Gray_Bear (Bishop)
on Jun 05, 2014 at 22:35 UTC ( [id://1088941]=note: print w/replies, xml ) Need Help??


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

In Your code:
return unless $dirStats[2] & $mask == $mask;
Do you mean:
return unless ($dirStats[2]) & ($mask == $mask);
or
return unless ($dirStats[2] & $mask) == $mask;
or something else entirely?

Parenthetical aside: the Perl interpreter makes guesses about intent based on the Precedence Rules. You can use parentheses to explicitly say what you want and remove the guess-work.

----
I Go Back to Sleep, Now.

OGB

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found