Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Answer: How can I split a string into chunks of size n bytes?

by MeowChow (Vicar)
on Apr 24, 2001 at 10:15 UTC ( #74971=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How can I split a string into chunks of size n bytes? - Answer contributed by MeowChow

push @bits, substr $scalar, 0, $bytes, '' while length $scalar;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[choroba]: Any Monks online that can check what went wrong?
[Copacetic]: Sorry, I've just discovered that it gives a useful error message if I select "preview" (as well as removing the "create" button for some reason). It was that my title wasn't long enough. Thanks for your help.
[choroba]: :-)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-05-26 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?