in reply to how do i read in ANY 2d array
It depends entirely upon how the data is stored in the file.
For a matrix stored such that the rows are white-space delimited, and columns newline delimited, then this does the trick:
my @matrix = map[ split ], <$filehandle>;
Though if the file/matrix is of any substantial size, then this may be preferable:
my @matrix; push @matrix, [ split ] while <$filehandle>;
|
|---|