in reply to ||= oddity

I'd say the problem is that you're evaluating @bar in scalar context (which gives the number of elements in the array), and that you're then trying to modify that number (which you can't). This is similarly nonsensical as @bar++, or @bar += 5, or @bar |= 1, etc.  All of those assume/force scalar context on the left hand side.