This queue is for tickets about the Text-CSV_XS CPAN distribution.

Report information
The Basics
Id:
24386
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
HMBRAND [...] cpan.org
Requestors:
melazyboy [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
0.23
Fixed in:
0.25



Subject: \t doesn't work in _XS, works in _PP
The following code works, however _XS, does not work. _XS will not accept '\t', or "\t" as sep_char. It will still use ',' as the sep_char. This causes problems with DBD::CSV too. Trying to process the tab file in DBD::CSV, it will fail silently. In Text::CSV_XS you can see setting sep_char has no effect.. use Text::CSV_PP; use Data::Dumper; my $csv = Text::CSV_PP->new({ sep_char => "\t" }); open (my $fh, '<', 'db.csv'); while ( <$fh> ) { $csv->parse($_); print Dumper [ $csv->fields ]->[23]; }
Subject: db.csv

Message body is not shown because it is too large.

Subject: proc.pl
#!/usr/bin/perl -l use strict; use warnings; use Text::CSV_PP; use Data::Dumper; my $csv = Text::CSV_PP->new({ sep_char => "\t" }); open (my $fh, '<', 'db.csv'); while ( <$fh> ) { $csv->parse($_); print Dumper [ $csv->fields ]->[23]; }
I have added a test in the suite as a regression test. The current state, 0.25, works for me. In the upcoming 0.26, you can find the test in t/70_rt.t, where I will gather test cases for RT reports. Please test with 0.25 and feel free to contact me if you still have problems.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.