As has been mentioned, you're getting the "string" bitwise conversion. Since you want to use numeric, just change the line:
my $or;
to:
my $or = 0;
This way, since you'll have a numeric value in $or, perl will convert the operands to integers before doing the '|', and you'll get the desired numeric version.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Counter Intuitive Code
by roboticus
in thread Counter Intuitive Code
by writch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |