in reply to Bytes to bits

Well, that depends on how you want to represent those bits. Remember that $result is a one character string, containing 8 bits already.

You might want to lookup the working of vec, that may very well do what you want to do.

Abigail