Skip Menu |

This queue is for tickets about the AnyData CPAN distribution.

Report information
The Basics
Id: 5859
Status: resolved
Priority: 0/
Queue: AnyData

People
Owner: JZUCKER [...] cpan.org
Requestors: wright [...] smx.pair.com
Cc:
AdminCc:

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



Date: Wed, 31 Mar 2004 13:32:28 -0500 (EST)
From: Dan Wright <wright [...] smx.pair.com>
To: bug-AnyData [...] rt.cpan.org
Subject: AnyData bug?
Jeff, I'm looking at the source code for AnyData.pm and I'm really confused about the adConvert sub. It looks like it is calling get_undeleted_record, and expecting an arrayref back, but I don't think you are guaranteed to get an arrayref back. In fact, I'm sure you aren't. Here's an example failure case: % cat example1.csv name,expires,nameserver pair.com,17-aug-2012,NS1.PAIR.COM pairnic.com,15-jun-2008,NS0.NS0.COM pm.org,21-Aug-2005,NS.DEVELOOPER.COM perlmonks.com,10-sep-2006,NS1.EASYDNS.COM typepad.com,31-mar-2005,NS1.PAIRNIC.COM wright@pit24% perl -MAnyData -e "adConvert( 'CSV', 'example1.csv', 'HTMLtable', 'example1.html')" Can't use string ("pair.com,17-aug-2012,NS1.PAIR.CO") as an ARRAY ref while "strict refs" in use at /usr/local/lib/perl5/site_perl/5.6.1/AnyData.pm line 657, <GEN0> line 2. In order to make this work, I think you need to copy over some code that you are using in fetch_row(). Here's the diff for AnyData 0.08: 366c366,370 < return $rec; --- Show quoted text
> return $rec if ref $rec eq 'ARRAY'; > return unless $rec; > my @fields = $self->{parser}->read_fields($rec); > return undef if scalar @fields == 1 and !defined $fields[0]; > return \@fields;
-Dan
Thanks much for the patch. I applied it only slightly modified. The problem should be fixed in AnyData 0.09. Thanks! -- Jeff