This is a result of Perl's loose typecasting. If perl thinks your operands should be treated as strings, it will operate accordingly. How did you set the initial values of those variables, and what do you do with them just before the |= happens?
Its not a bug, more of a subtle result of loose typecasting. If you set the variables in string context, i.e.