in reply to
Re^2: Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?
in thread Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?
That's because decorate has an even higher precedence
(on the left of any operator except commas, and unless parenthesis are involved) so what happens is actually:
(This is of course, not actual code, but just a representation)
((return $decorated_foo), (return $decorated_bar.'!'))
((return $decorated_foo), (return $decorated_bar_with_exclamation_mark
($decorated_foo, (return $decorated_bar_with_exclamation_mark))
So first the calls to decorate
are resolved, then the concatenation, and at last the values are added to the list. But the concatenation does not happen last.
Edit: "removed" a bit about precedence being higher on the left of some operators, because it's late, and I'm not sure about what I'm saying.