Skip Menu |

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

Report information
The Basics
Id: 58356
Status: resolved
Priority: 0/
Queue: Text-CSV

People
Owner: Nobody in particular
Requestors: adam_misc [...] yahoo.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.17
Fixed in: (no value)



Subject: Incorrect CSV generated if "quote_space => 0"
Thanks for writing and maintaining this module. I'm using it in my little perl program and I believe I have found a bug. If I initialize like this my $csv = Text::CSV->new ({ binary => 1, quote_space => 0, eol => $/ }); Then later print like this $csv->print($lOutFh, \@lArray); CORRECT: fields containing a space are not quoted BUG: fields are not quoted even when they contain a comma Patch file that I think fixes this is attached. I don't believe this is OS or perl version dependent, but just in case, here is what I'm using: $ perl -v This is perl, v5.10.1 (*) built for i686-cygwin-thread-multi-64int (with 12 registered patches, see perl -V for more detail) $ uname -a CYGWIN_NT-5.1 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin Thanks Adam
Subject: CSV_PP.pm.diff
--- ORIG__CSV_PP.pm 2010-06-13 10:41:13.656250000 +0100 +++ CSV_PP.pm 2010-06-13 10:42:19.937500000 +0100 @@ -307,7 +307,7 @@ $must_be_quoted++; } if($column =~ /$re_sp/){ - $must_be_quoted++ if $quote_space; + $must_be_quoted++; } if( $binary and $quote_null ){
Thanks for your report and patch. I released the new version. Please check it.