For long input strings, the following should be faster than the previously submitted solutions:
my $out = unpack('B*', $str) =~ s/.(.{7})/$1/sgr; # 5.14+ ( my $out = unpack('B*', $str) ) =~ s/.(.{7})/$1/sg; # 5.6+
In reply to Re: Convert ASCII string to 7-bit binary string
by ikegami
in thread Convert ASCII string to 7-bit binary string
by Pascal666
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |