Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Convert ASCII string to 7-bit binary string

by ikegami (Patriarch)
on Oct 28, 2015 at 21:18 UTC ( [id://1146330]=note: print w/replies, xml ) Need Help??


in reply to Convert ASCII string to 7-bit binary string

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+

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1146330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found