in reply to Testing & Using Bits
Perl has bitwise ops & and |. See the list of bitwise ops in perlop.
BCD can be ginned up with vec and split //.
After Compline,Zaxo