Roy Johnson and hardburn are both wrong. Both || and or impose scalar context on their left operand. The difference is that or has a lower precedence than = so between the two forms, only the one using or was written correctly.
@foobar = foo() || warn;
@foobar = ( scalar( foo() ) || warn );
@foobar = foo() or warn;
scalar( @foobar = foo() ) || warn;
In reply to Re: '||' vs 'or' with subroutines
by diotalevi
in thread '||' vs 'or' with subroutines
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |