The ||= only gets one shot to evaluate the left side and since it needs a boolean, it does it in scalar context. The context of the right hand side is determined by the left side so foo() is scalar too.
You really ought to update your node title though. It's misleading. The central question is about context and you'd want to use a title like "Why are "(a) || b" and "(a) = a || b" different."
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re: Why are "a ||= b" and "a = a || b" different?
by diotalevi
in thread Why are "a ||= b" and "a = a || b" different?
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |