@bar can't hold the result of ||= since @bar is an array and the result is a scalar. The LHS of ||= must be a scalar lvalue.
The following will do what you want:
@bar = (1,2,3) if !@bar;
I admit, the error message could be much clearer.
In reply to Re: ||= oddity
by ikegami
in thread ||= oddity
by throop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |