Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: need help to create array dynamically

by Kenosis (Priest)
on Jan 23, 2013 at 18:49 UTC ( #1014986=note: print w/replies, xml ) Need Help??

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?

Replies are listed 'Best First'.
Re^2: need help to create array dynamically
by vkp (Novice) on Jan 23, 2013 at 19:15 UTC

    sorry for confusion.

    [ abababa bcbcbcb ]

    Data is in this format. It is not in a line. But each start with "[" and end with "]". the array in which i shall put all these 4 lines would not be a one element array then. I shall put this 4 lines in one array , another 4 lines in another array... like this fashion, i need to reads whole file.

      Thank you for the clarification.

      Why a separate array for each 'chunk?' How will you manage these? What's the end result? Are there blank lines between these chunks? Also, how large is this file?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014986]
[Discipulus]: Eily i'm testing a failure: i ok if i get bad results.. perhaps there is another way to do it...
[Discipulus]: in other words: i have a contructor that carps on missing arguments and I want to test that it fails correctly, without carping out in the test output

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2018-01-22 11:31 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (233 votes). Check out past polls.