in reply to Re^2: issue with LF & CRLF
in thread issue with LF & CRLF

If you create an example file that contains one good record, and one problematic record, then you'll have a test case that is easier to Dump and share here. Below is a little example that works here and shows an embedded newline being handled correctly by Parse::CSV:

use Parse::CSV; use Data::Dump 'pp'; my $fh = new IO::File('failing.csv', 'r'); my $fail = do { local $/; <$fh> }; pp $fail; # Print input $fh->seek(0,0); $/ = "\r\n"; my $parser = Parse::CSV->new( handle => $fh, csv_attr => { binary => 1 }, ); print pp $_ while $_ = $parser->fetch; # Print output
Which prints:
"a,b,c,d,e,f,g\r\na,b,c,\"kkkk\n\",d,e,f,g\r\n" ["a" .. "g"]["a", "b", "c", "kkkk\n", "d" .. "g"]