You have three areas of confusion. First, is the context in which operands are evaluated.
| is a math operation. It requires two numbers on which to operate. Its operands are evaluated in scalar context.
|| is a conditional operator. It requires its LHS to be true of false. Its LHS operand is evaluated in scalar context. Since it doesn't need to inspect the RHS, the context in which the operator is evaluated is propagated to its RHS operand.
or is identical to || except in precedence.
You also seem to have a problem understanding the different precedence of the || and or operators.
my @list0 = x() || (1,2,3); means my @list0 = ( x() || (1,2,3) );
my @list1 = x() or (1,2,3); means ( my @list0 = x() ) or (1,2,3);
Finally, it appears that bbox returns something different in scalar context ([51,3,102,55]) than in list context ((51,3,102,55)).
It is not only functioning as documented, but as intentionally and thoughtfully designed.
In reply to Re: 'or' versus '||' - Unexpected Results
by ikegami
in thread 'or' versus '||' - Unexpected Results
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |