demerphq <demerphq@gmail.com> writes: > Perl defines that "7" and 7 are both equivalent in almost every > regard, the few places they might not be the dev is expected to > disambiguate, eg logical operators like ^ | & care, nothing else in These are bitwise operators, not logical, and are an anomalous exception to the usual rule in perl that the operator decides what to treat the operand as. > perl does, and in those cases the dev should be specifying which > behavior they want by doing 0+$x | 0+$y or "$x" | "$y". Because to > perl both "are" the number seven and both "are" the string "7". To remedy this anomaly, the 'bitwise' feature was introduced in 5.22 and and added the :5.28 and later feature bundles. It makes the plain bitwise operators consistently treat their arguments as integers, and adds dotted variants (&. |. ^. ~.) that treat the arguments as strings. https://metacpan.org/pod/feature#The-'bitwise'-feature > cheers, > Yves - ilmariThread Previous | Thread Next