http://www.perlmonks.org?node_id=1014986


in reply to need help to create array dynamically

...and provide a good sample of your data (e.g., is [ abababa bcbcbcb ] on one line or are there multiple instances per line or can one be spread across two lines?). If it contains information that's not suitable for public consumption, redact that...

Also, help me understand the following:

I have to put each chunk in different arrays.

Do you really mean one array per chunk (i.e., creating one-element arrays) or did you mean that each chunk needs to be an array element?