in reply to how to set bits in an arbitrary length string
I had forgotten about vec :-(.
I need the least significant bit in the rightmost position.
So what I use now is:
$binary = chr(0) x 8; vec($binary, $_, 1) = 1 for (SOME, CONSTANTS); $binary = reverse $binary;
|
|---|