|
I'm trying to edit an OpenOffice Writer Table with the following script
use OpenOffice::OODoc;
$doc = ooDocument(file => "OOWriter_file.odt");
$t = $doc->getTable("Tablename");
($rows, $cols) = $doc->getTableSize($t);
print "rows: ". $rows ." cols: ". $cols ."\n";
$r_num = $rows -2;
$row = $doc->getTableRow($t, $r_num) or die ("couldn't get row $r_num");
print "is row\n" if $row->isTableRow;
$doc->deleteTableRow($t, $r_num) or die("couldn't delete row $r_num");
$doc->save;
It results in following output:
Can't call method removeElement on an undefined value at c:/Perl/site/lib/OpenOffice/OODoc/Text.pm
+line 3035.
rows: 47 cols: 3
is row
What am I doing wrong?
|