in reply to Warnings and bitwise and

If "a" means the hexadecimal 0xA, then you must use hex:
perl -e 'use warnings; $a = "a"; if (hex($a) & 1 << 7) {print "happy\n +"}'