in reply to Why are "a ||= b" and "a = a || b" different?
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."
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why are "a ||= b" and "a = a || b" different?
by saintmike (Vicar) on Mar 03, 2007 at 01:08 UTC | |
by liverpole (Monsignor) on Mar 03, 2007 at 02:38 UTC | |
by saintmike (Vicar) on Mar 03, 2007 at 06:18 UTC | |
by diotalevi (Canon) on Mar 03, 2007 at 18:45 UTC | |
by saintmike (Vicar) on Mar 04, 2007 at 21:27 UTC | |
by diotalevi (Canon) on Mar 04, 2007 at 22:18 UTC | |
by saintmike (Vicar) on Mar 04, 2007 at 22:59 UTC | |
by xdg (Monsignor) on Mar 03, 2007 at 02:36 UTC | |
Re^2: Why are "a ||= b" and "a = a || b" different?
by saintmike (Vicar) on Mar 03, 2007 at 06:31 UTC |