I'm trying to convert from an ASCII string to the 7-bit binary representation of that string. So "4B" converts to "01101001000010", for example. The below works, but I feel like there has to be a better way.
for (split //, '4B') { $_ = unpack 'B8'; s/^.//; $out .= $_; }
In reply to Convert ASCII string to 7-bit binary string by Pascal666
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |