Do you mean you want the ASCII code of $a? If so, use ord and some extra brackets:
my $a = "a"; if ( (ord($a) & 1) << 7) {print "happy\n"}
Update:
if ( ord($a) & (1 << 7) ) {print "happy\n"}
seems to make more sense
In reply to Re: Warnings and bitwise and
by FunkyMonk
in thread Warnings and bitwise and
by MedicLdr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |