Text::CSV is not what is reporting the error. csv2xls.pl is.
Here is a code snippet that duplicates the problem.

By the way, the data originators paste lines and/or paragraphs from Word into a form that puts it into a proprietary data base within a program called DOORS. DOORS exported the db as a ',' separated csv file. The csv has under 9K rows with lots of embedded newlines, and non-ascii chars.

use Text::CSV; use UTF8BOM; use utf8; use Encode; use strict; my $origfile = 'csv.csv'; my $infile = 'csv_in.csv'; `cp -f $origfile $infile`; my $outfile = 'csv_out.csv'; my $in_fh; #`cp csv.csv $infile`; UTF8BOM->remove_from_file($infile); my @rows; my $csv = Text::CSV->new ( { binary => 1 } ) or die "Cannot use CSV: ".Text::CSV->error_diag (); open my $in_fh, "<:encoding(utf8)", "$infile" or die (__LINE__.": \n") +; while ( my $row = $csv->getline( $in_fh ) ) { $row->[4] =~ m/Hardware/ or next; # Causes csv2xls.pl problems. push (@rows, ($row)); } $csv->eof or $csv->error_diag(); close $in_fh; $csv->eol ("\r\n"); my $csv_out; my $num_rows = @rows; print ("There are $num_rows rows\n"); open $csv_out, ">:encoding(utf8)", "$outfile" or die(__LINE__.": \n"); $csv->print ($csv_out, $_) for @rows; close $csv_out or die (__LINE__.": \n"); unlink("csv_out.xls"); `csv2xls.pl -u csv_out.csv`;

In reply to Re^2: CSV_XS ERROR: 2027 - EIQ - Quoted field not terminated @ pos 408 by Anonymous Monk
in thread CSV_XS ERROR: 2027 - EIQ - Quoted field not terminated @ pos 408 by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.