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

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

People
Owner:
Nobody in particular
Requestors:
SREZIC [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Unimportant
Broken in:
0.35
Fixed in:
0.65



Hello Merijn, the Text::CSV_XS documentation suggests to use error_diag like this: $csv = Text::CSV_XS->new ({ ecs_char => 1 }) or die Text::CSV_XS->error_diag (); to get this result: "Unknown attribute 'ecs_char'" However, it returns this result: 1000Unknown attribute 'ecs_char'0 at /tmp/csv2.pl line 4. Probably the documentation should be changed to force the stringified output, maybe like this: $csv = Text::CSV_XS->new ({ ecs_char => 1 }) or die "" . Text::CSV_XS->error_diag (); Regards, Slaven
Subject: Re: [rt.cpan.org #46076]
Date: Thu, 14 May 2009 16:36:04 +0200
To: bug-Text-CSV_XS@rt.cpan.org
From: "H.Merijn Brand" <h.m.brand@xs4all.nl>
On Thu, 14 May 2009 10:28:24 -0400, "Slaven_Rezic via RT" <bug-Text-CSV_XS@rt.cpan.org> wrote:
Show quoted text
> the Text::CSV_XS documentation suggests to use error_diag like this: > > $csv = Text::CSV_XS->new ({ ecs_char => 1 }) or > die Text::CSV_XS->error_diag (); > > to get this result: > > "Unknown attribute 'ecs_char'" > > However, it returns this result: > > 1000Unknown attribute 'ecs_char'0 at /tmp/csv2.pl line 4. > > Probably the documentation should be changed to force the stringified > output, maybe like this: > > $csv = Text::CSV_XS->new ({ ecs_char => 1 }) or > die "" . Text::CSV_XS->error_diag ();
Nice catch. Thanks. What is better in your opinion to clear this in the docs or die "".Text::CSV_XS->error_diag (); or or die scalar Text::CSV_XS->error_diag (); -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00, 11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
On Thu May 14 10:36:26 2009, h.m.brand@xs4all.nl wrote:
Show quoted text
> On Thu, 14 May 2009 10:28:24 -0400, "Slaven_Rezic via RT" > <bug-Text-CSV_XS@rt.cpan.org> wrote: >
> > the Text::CSV_XS documentation suggests to use error_diag like this: > > > > $csv = Text::CSV_XS->new ({ ecs_char => 1 }) or > > die Text::CSV_XS->error_diag (); > > > > to get this result: > > > > "Unknown attribute 'ecs_char'" > > > > However, it returns this result: > > > > 1000Unknown attribute 'ecs_char'0 at /tmp/csv2.pl line 4. > > > > Probably the documentation should be changed to force the stringified > > output, maybe like this: > > > > $csv = Text::CSV_XS->new ({ ecs_char => 1 }) or > > die "" . Text::CSV_XS->error_diag ();
> > Nice catch. Thanks. What is better in your opinion to clear this in the > docs > > or die "".Text::CSV_XS->error_diag (); > > or > > or die scalar Text::CSV_XS->error_diag (); >
I have no strong preference. But I think that it's slighly more common in the perl world to use scalar(...) for context disambiguation.
Thanks.


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.