Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by Aristotle (Chancellor)
on Oct 02, 2003 at 23:55 UTC ( [id://296126]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I split a string into chunks of size n bytes?
in thread How can I split a string into chunks of size n bytes?

And in case you don't care whether the last group is complete,
my @groups = unpack "a$n" x ( ( length($string) / $n ) - 1 ) . "a*", $ +string;

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found