in reply to '||' vs 'or' with subroutines

Context. The || notation indicates that you want to logically-or the output of foo() (update the left operand of ||) with that of warn "Yikes!". You don't. Parentheses could make it work like you want:
(@foobar = foo()) || warn "Yikes!";
although I think it's more clear to use or for flow-control things like this.

Update: Diotalevi's explanation is more clear, but mine is not "wrong". It is a matter of context being imposed on the output of foo() by the ||. or would put the (result of the) assignment in scalar context, which doesn't affect the assignment itself.


Caution: Contents may have been coded under pressure.