"be consistent" | |
PerlMonks |
Re: Counter Intuitive Codeby Corion (Patriarch) |
on Mar 27, 2019 at 14:41 UTC ( [id://1231749]=note: print w/replies, xml ) | Need Help?? |
What you get is the string-biwise-or, not the number-bitwise-or:
If you tell Perl that you want the things to be really treated as numbers, the bitwise-or operator acts on the numerical representations:
Prefixing 0+ in front of an expression is the canonical way in Perl to make a value be treated more as a number.
In Section
Seekers of Perl Wisdom
|
|