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.