it sounds like you've just asserted two mutually exclusive things. 1. Assignment always evaluates arguments in list context. 2. Scalar and list assignment provide different contexts.
Point 1 is a misquote. I said "the aassign operator unconditionally evaluates its operands in list context". "aassign" is short for "list assignment operator". I defined "aassign" earlier on, but I now recognize it hard to distinguish it from "assign" visually.
Reading further up the comment chain, you are saying that the parens on the left change which assignment operation is used and that is what determines the context. Do I understand this correctly?
Yes. Re^10: chopping a string into slices - is there a more elegant way to do it? shows this.
This talks about the context in which = is evaluated, but says nothing about how the arguments are evaluated. This may be the source of my (and others) confusion.
Re^10: chopping a string into slices - is there a more elegant way to do it? describes the two operations in detail.
So, just to be clear, you are saying that the parens on the left of the =, just like a list on the left, trigger the use of the list assignment, correct?
Yes. A hash or an array would also do that.
$a= scalar assign f()= scalar assign @a= list assign %a= list assign (EXPR,...)= list assign (EXPR)= list assign ()= list assign
In reply to Re^13: chopping a string into slices - is there a more elegant way to do it?
by ikegami
in thread chopping a string into slices - is there a more elegant way to do it?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |