in reply to 'or' versus '||' - Unexpected Results

For this kind of thing B::Deparse can be a big help.

perl -MO=Deparse,-p -e 'sub x {return (1,2)} @c=x()||(1,2);@d=x() or ( +1,2);' sub x { return(1, 2); } (@c = (x() || (1, 2))); ((@d = x()) or ('???', '???'));

You can see here how the precedence difference between || and or make a difference in what happens.