Your skill will accomplish what the force of many cannot |
|
PerlMonks |
List's terminology and Parentheses in Perlby LanX (Saint) |
on Jul 18, 2020 at 12:03 UTC ( [id://11119489]=note: print w/replies, xml ) | Need Help?? |
You have cited perldocs, unfortunately without linking to the references.
List TerminologyThe term "list value" was confusing me, in such cases I recommend looking into perlglossary#LIST ff. NB: Perlglossary is from an appendix from the Camel (IIRC), while the perldocs were written by different authors.
A syntactic construct representing a comma- separated list of expressions, evaluated to produce a list value. Each expression in a LIST is evaluated in list context and interpolated into the list value.
An ordered set of scalar values.
The situation in which an expression is expected by its surroundings (the code calling it) to return a list of values rather than a single value. Functions that want a LIST of arguments tell those arguments that they should produce a list value. See also context.
An operator that does something with a list of values, such as join or grep. Usually used for named built-in operators (such as print, unlink, and system) that do not require parentheses around their argument list.
An unnamed list of temporary scalar values that may be passed around within a program from any list-generating function to any function or construct that provides a list context.
ParenthesesI think one source of confusion (besides @arrays) is the syntactic meaning of parentheses ...(...)... in different constructs.
... those constructs impose a list context inside But ...
Examples (updated)please see Examples for "LIST", "list context", "list value", "list assigment", "list operator"
Cheers Rolf °) well modulo sub-prototype
In Section
Meditations
|
|