Subject: | Method adConvert of AnyData-0.08 cannot convert CSV to HTMLtable. |
I found that a below description returns error.
print adConvert(
"CSV",
#6column CSV Data
'test.csv',
'HTMLtable',
undef,
{cols => 'col1,col2,col3,col4,col5,col6'},
);
The following is the above error:
Can't use string ("hogehoge,foobar,hogehoge,foobar,") as an ARRAY ref
while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.1/AnyData.pm
line 657
My platform is Solaris8.
Currently, I use a bellow script to avoid the error:
#!perl -w
use strict;
use AnyData;
my $arrayref = adConvert(
"CSV",
#6column CSV Data
'test.csv',
'ARRAY',
undef,
{cols => 'col1,col2,col3,col4,col5,col6'},
);
print adConvert(
'ARRAY',
[
[@{$arrayref->[0]}],
map { [split /,/, $_] } @$arrayref[1..$#$arrayref]
],
'HTMLtable'
);
__END__
But, this shall bring memory over for a big file.
Lastly, I'm sorry that my English is very poor because I'm a Japanease.
Taro Nishino