Mahurshi Akilla wrote:
I am trying to read a csv file into a 2D array matrix

I am having a hard time trying to get the array returned by split
function to "attach" to a 2D array.

See the code below for further info on what I'm trying to do ....

## initialize
$row = 0;
$col = 0;

## go thru each line of file
while (<STDIN>) {

  ## need to correct below line to append array returned by split to
$matrix[$row][ ....]
  $matrix[$row] = split (/,/, $_);

    push @matrix, [ split /,/ ];




John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to