in reply to Re^3: grep for hash?
in thread grep for hash?
I think it's pretty safe to count that the rvalue will be computed and available before the lvalue is populated with it.
In general, no. The container can be placed on the stack before the value it will receive. The assignment only occurs after both the value and the container are on the stack.
In Perl, operands are always evaluated from left to right, except the operands for assignment operators are always evaluated from right to left. But that's not documented.
| Given | Disinguishes these Interpretations | |
|---|---|---|
| Operator Precedence | 1+2*3 | (1+2)*3 -vs- 1+(2*3) |
| Operator Associativity | 2**3**4 | (2**3)**4 -vs- 2**(3**4) |
| Operand Evaluation Order | foo()+bar() | foo() -> bar() -> add -vs- bar() -> foo() -> add |
Update: I foresaw confusion between operator associativity and operand evaluation order, so I added the table.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: grep for hash?
by Fletch (Bishop) on Jul 07, 2009 at 16:34 UTC | |
by ikegami (Patriarch) on Jul 07, 2009 at 16:38 UTC | |
by Fletch (Bishop) on Jul 07, 2009 at 16:54 UTC |