in reply to Using Text::CSV
If reading from a stream, please forget about parse () and fields (). The two are combined a lot faster and more efficient into getline () when working in streams.
open my $fh, "<", "file.csv" or die "file.csv: $!\n"; while (my $row = $csv->getline ($fh)) { $row->[8] =~ m/criterium/ or next; # do something with this line } $csv->eof or $csv->error_diag ();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Text::CSV
by ikegami (Patriarch) on Sep 24, 2009 at 15:45 UTC | |
by Tux (Canon) on Sep 25, 2009 at 06:12 UTC | |
by ikegami (Patriarch) on Sep 25, 2009 at 06:34 UTC | |
by Tux (Canon) on Sep 25, 2009 at 07:58 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |