Subject: | Error passing an array with a zero value in position 1 to add_dataset |
When the function add_dataset receives an array with a zero value in the
second position, for example @data = (1,0,2,3,4,5), the function exist
with error:
"Can't use string ("0") as an ARRAY ref while "strict refs" in use at
/usr/local/lib/perl5/site_perl/5.6.1/SWF/Chart.pm line 257"
This seems to be produced that having a zero in position 1 makes the
condition check in the function to be ignored an thus not converting the
array into the format expected by the object.
There is a workaround that consist in passing the array as a reference,
i.e. $graph->add_dataset(\@data) instead of $graph->add_dataset(@data).