Subject: | Doesn't handle empty arrays for loops |
Empty arrays for loops cause an error. HTML::Template eats them just fine though.
--------------------------------------------
This is perl, v5.8.2 built for i86pc-solaris
--------------------------------------------
--------------------------------------------
error message:
--------------------------------------------
Modification of non-creatable array value attempted, subscript -1 at [snip]/Excel/Template/Iterator.pm line 62.
--------------------------------------------
test perl script:
--------------------------------------------
use strict;
use Excel::Template;
my $tmpl = new Excel::Template(filename => "excel_template_test.xml");
$tmpl->param(list => [ ]);
$tmpl->write_file("test.xls");
--------------------------------------------
excel_template_test.xml:
--------------------------------------------
<workbook>
<worksheet name="Test">
<row>
<cell text="List:"/>
<loop name="list">
<cell><var name="value"/></cell>
</loop>
</row>
</worksheet>
</workbook>