The Elite Noob has asked for the wisdom of the Perl Monks concerning the following question:
So what I want to do is read the first line. then create a multi-array the size using the first number to figure out how many lines there. And the second number is how many elements per array. so the First set of data would have an array. "@array[3][3]".Now i need to read the next 3 lines and put the digits of each line in the array. so3 3 3 6 5 2 4 5 1 5 7 -- 2 4 1 4 5 9 3 8 6 8 -- 5 3 1 5 3 7 3 6 4 7 9 1 2 3 5 7 1
@array[0][0] = 3; @array[0][1] = 6; @array[0][2] = 5; @array[1][0] = 2; @array[1][1] = 4; @array[1][2] = 5;
Then when it encounters "--" in a file it stops reading. Then it calculates based off the array. Then when it starts reading again. It is after the first "--". So the program creates an array "@array[2][4]". And this continues.
So anyone any idea how i start reading again from where i left off? Thanks and all help is appreciated!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading Input from files and separating them into arrays.
by wind (Priest) on Mar 29, 2011 at 23:45 UTC | |
| |
|
Re: Reading Input from files and separating them into arrays.
by GrandFather (Saint) on Mar 30, 2011 at 02:40 UTC | |
by The Elite Noob (Sexton) on Mar 30, 2011 at 17:15 UTC |