X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/b687b08b628449b317ff558f31d9d716ace045de..43192e07925c626b8d615aff545160df8bd7c3f8:/pod/perlfunc.pod diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index e8546be..efa7b58 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -12,11 +12,12 @@ operators take more than one argument, while unary operators can never take more than one argument. Thus, a comma terminates the argument of a unary operator, but merely separates the arguments of a list operator. A unary operator generally provides a scalar context to its -argument, while a list operator may provide either scalar and list +argument, while a list operator may provide either scalar or list contexts for its arguments. If it does both, the scalar arguments will be first, and the list argument will follow. (Note that there can ever -be only one list argument.) For instance, splice() has three scalar -arguments followed by a list. +be only one such list argument.) For instance, splice() has three scalar +arguments followed by a list, whereas gethostbyname() has four scalar +arguments. In the syntax descriptions that follow, list operators that expect a list (and provide list context for the elements of the list) are shown @@ -29,7 +30,7 @@ Elements of the LIST should be separated by commas. Any function in the list below may be used either with or without parentheses around its arguments. (The syntax descriptions omit the parentheses.) If you use the parentheses, the simple (but occasionally -surprising) rule is this: It I like a function, therefore it I a +surprising) rule is this: It I like a function, therefore it I a function, and precedence doesn't matter. Otherwise it's a list operator or unary operator, and precedence does matter. And whitespace between the function and left parenthesis doesn't count--so you need to @@ -47,6 +48,11 @@ example, the third line above produces: print (...) interpreted as function at - line 1. Useless use of integer addition in void context at - line 1. +A few functions take no arguments at all, and therefore work as neither +unary nor list operators. These include such functions as C