in reply to read files into 2D arrays and print element?
When I try to print element [0]1 from each matrix in each file, ... Does anyone have any idea why this is wrong?
@list is declared outside your for loop, so you are accumulating the data for all the files into the array; thus whatever value you put into $list[0][1] first, will never change.
If you move the declaration of @list inside the for loop, you'll probably get what you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: read files into 2D arrays and print element?
by fasoli (Beadle) on Nov 29, 2016 at 17:09 UTC |