in reply to Re^2: Convert ASCII string to 7-bit binary string
in thread Convert ASCII string to 7-bit binary string

Mea culpa; I should pay more attention, and not just assume that two similar-looking binary strings are, in fact, the same. Thanks for the correction.

Fortunately it's easily-fixed; just use substr in the substitution to chop off the first character:

($out = $string) =~ s/(.)/substr unpack('B8', $1), 1/eg;

Replies are listed 'Best First'.
Re^4: Convert ASCII string to 7-bit binary string
by ikegami (Patriarch) on Oct 28, 2015 at 21:22 UTC
    Seems like a weird way of writing the following to me:
    $out = map { substr unpack('B8', $1), 1 } $string =~ /./g;