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

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