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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.

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
    Oh!!! Thanks so much!