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