Actually, || is not a bit-wise operator.
The reason that my statements like this:
socket $sock, PF_INET, SOCK_STREAM, $proto || die $!;
...aren't dying properly is because , has lower operator precedence than ||. The or operator has the lowest precedence. See the perlop docs.
This means that statement was evaluated like this:
socket $sock, PF_INET, SOCK_STREAM, ($proto || die $!);
...instead of like this:
socket ($sock, PF_INET, SOCK_STREAM, $proto) || die $!;
And this is now making me question the wisdom of PBP's rules of: Don't use unnecessary parentheses for builtins and "honorary" builtins. Because I was thinking that functions in the Socket module were essentially honorary builtins. |