in reply to Reading a CSV file
This isn't the source of your problem, but it is something else you'll need to fix. On this line:
while (($read)=<IN>) {
By putting $read in parentheses, you create a list context for the <IN>. As such, it will read the whole file and just put the first line in $read.
my $line; while ( ($line) = <DATA> ) { print "line: $line"; } __DATA__ line 1 line 2 line 3
This outputs:
line: line 1
I think you want this instead:
while ($read=<IN>) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading a CSV file
by alchang (Novice) on Mar 31, 2008 at 14:40 UTC |