From 0d043efa5001bcca81315a3a7a5ec260f9b378ff Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 27 Aug 2011 17:39:40 -0700 Subject: [PATCH] =?utf8?q?Document=20getprotobynumber=E2=80=99s=20preceden?= =?utf8?q?ce?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- pod/perlfunc.pod | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index f97e79a..f457188 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2423,6 +2423,13 @@ you can write this: Make sure C is called in SCALAR context and that its return value is checked for definedness. +The C function, even though it only takes one argument, +has the precedence of a list operator, so beware: + + getprotobynumber $number eq 'icmp' # WRONG + getprotobynumber($number eq 'icmp') # actually means this + getprotobynumber($number) eq 'icmp' # better this way + If you get tired of remembering which element of the return list contains which return value, by-name interfaces are provided in standard modules: C, C, C, -- 2.7.4