Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^2: AJP ping

by jffry (Hermit)
on Nov 18, 2011 at 22:37 UTC ( #938921=note: print w/replies, xml ) Need Help??

in reply to Re: AJP ping
in thread AJP ping

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2023-03-25 04:11 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (62 votes). Check out past polls.