in reply to Re: bitwise operators
in thread bitwise operators

If only one of them is a number and the other a string, both will be treated as integers.
$x = "161"; # a string print $x & 255; # the other one is a number...
Result:
161

Assuming the "161" comes from user input and the 255 is hardcoded, there's no reason to have a problem.

Replies are listed 'Best First'.
Re^3: bitwise operators
by Anonymous Monk on Jan 19, 2005 at 17:56 UTC
    No, but that's a big if. This is 2005, and A-, B-, C- subnets are so 1980s. If I have a /23 subnet, I won't be using 255 exclusively.
    $ ifconfig | awk 'NR == 2 {print $4}' Mask:255.255.224.0