in reply to Re: Slurping strings from text file and pushing to array?
in thread Slurping strings from text file and pushing to array?

Thanks, but wouldn't that put each line of the text file as an element in an array? What I need is each line to be it's own array and each comma separated chunk of text to be an element in one of those arrays.

Or am I mis-understanding?

  • Comment on Re^2: Slurping strings from text file and pushing to array?

Replies are listed 'Best First'.
Re^3: Slurping strings from text file and pushing to array?
by ikegami (Patriarch) on Jul 01, 2010 at 22:02 UTC
    my @lines; @ARGV = $file; while (<>) { my @fields = ...; push @lines, \@fields; }

    @{$lines[0]} is the array for the first line.
    @{$lines[1]} is the array for the second line.
    etc