Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: How can I split a string into chunks of 4 characters

by davido (Cardinal)
on Dec 06, 2013 at 20:27 UTC ( [id://1066053]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I split a string into chunks of 4 characters
in thread How can I split a string into chunks of 4 characters

"push @a, $1 while s/(.{1,4})//;" produces the following: "0123 4abc", which is not the desired result.


Dave

Replies are listed 'Best First'.
Re^3: How can I split a string into chunks of 4 characters
by Lennotoecom (Pilgrim) on Dec 06, 2013 at 21:36 UTC
    i will cite the author
    "For example, string "01234abc" would become array 0123 4abc"
    it is exactly what my script does
    you sir, I suppose, didn't read the task

    got mistaken. im sorry

      From the OP:

      For example, string "01234abc" would become array ("0123", "1234","234a","34ab","4abc")

      Perhaps PetreAdi made an uncited alteration to the post, but the quoted example output data is what I remember seeing when I first read it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2026-04-13 13:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.