Skip Menu |

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

Report information
The Basics
Id: 35198
Status: resolved
Priority: 0/
Queue: Text-CSV_XS

People
Owner: HMBRAND [...] cpan.org
Requestors: rjk [...] tamias.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.42
Fixed in: 0.43



Subject: combine() fails when passed values from tied hash
When passed values from a tied hash, combine() inserts empty strings instead: #!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; use Tie::IxHash; for my $tie (0, 1) { my %hash; tie %hash, 'Tie::IxHash' if $tie; %hash = qw/ a b c d e f /; my $csv = Text::CSV_XS->new({eol => "\n"}); $csv->combine(values %hash); print $tie ? 'tied' : 'not tied', '=', $csv->string; } not tied=f,d,b tied=,, Text-CSV_XS-0.42 perl v5.8.7 Linux 2.6.16.29-xen #1 SMP Sun Sep 30 04:00:13 UTC 2007 x86_64 GNU/Linux
Subject: Re: [rt.cpan.org #35198] combine() fails when passed values from tied hash
Date: Fri, 18 Apr 2008 22:07:00 +0200
To: bug-Text-CSV_XS [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
I'll have to dig deeper on that. Should be doable, now that I `support' magic in $csv->print () I don't see why the sequence is different though: /pro/3gl/CPAN 115 > cat test.pl #!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; use Tie::IxHash; for my $tie (0, 1) { my %hash; tie %hash, "Tie::IxHash" if $tie; %hash = qw/ a b c d e f /; my $csv = Text::CSV_XS->new ({eol => "\n"}); print $tie ? 'tied' : 'not tied', '='; $csv->print (*STDOUT, [ values %hash ]); } /pro/3gl/CPAN 116 > perl test.pl not tied=f,d,b tied=b,d,f /pro/3gl/CPAN 117 > perl v5.10.0 built for i686-linux-64int Text::CSV_XS 0.42 Tie::IxHash 1.21 Linux 2.6.22.17-0.1-default/#1 i386 Core(TM)2 CPU T5600 @ 1.83GHz/1833(2) i686 2020 Mb -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/
From: rjk-cpan [...] tamias.net
Don't worry about the order of the values being different between tied/not tied. That's just what happens when you use Tie::IxHash. :)
Subject: Re: [rt.cpan.org #35198] combine() fails when passed values from tied hash
Date: Sat, 19 Apr 2008 19:14:34 +0200
To: bug-Text-CSV_XS [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Fri, 18 Apr 2008 16:54:36 -0400, "Ronald J. Kimball via RT" <bug-Text-CSV_XS@rt.cpan.org> wrote: Show quoted text
> > Queue: Text-CSV_XS > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=35198 > > > Don't worry about the order of the values being different between > tied/not tied. That's just what happens when you use Tie::IxHash. :)
Oh :) Now fixed. Will be in 0.43. If you want to check, get it from git: http://repo.or.cz/w/Text-CSV_XS.git snapshot: http://repo.or.cz/w/Text-CSV_XS.git?a=snapshot;h=abeee2821b69eede4178e5bb0aa8b46860d169ad;sf=tgz -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/