From 10083f11dbb5a4a9335d1877f7cb5c02811882dd Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 24 Mar 2021 11:23:28 +1100 Subject: [PATCH] setsockopt: document OPTVAL being inadvertantly treated as a string --- pod/perlfunc.pod | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 6ce02b081e29..f5c057520713 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -7299,6 +7299,10 @@ An example disabling Nagle's algorithm on a socket: use Socket qw(IPPROTO_TCP TCP_NODELAY); setsockopt($socket, IPPROTO_TCP, TCP_NODELAY, 1); +Beware: If a variable is supplied for OPTVAL and that variable has +been used as a string, setsockopt() might treat it as a packed string +instead of as an integer. + Portability issues: L. =item shift ARRAY