use strict; use warnings; use OpenOffice::OODoc; my $ods_doc = odfDocument(file => 'somefile.ods', create => 'spreadsheet',); # Set table to desired size my $sheet = 0; # First sheet in the file. my $num_rows = 3; my $num_cols = 1; # <- really small spreadsheet. $ods_doc->expandTable($sheet, $num_rows, $num_cols); # If you only need the cell to contain a text string, than # all you have to do is write to it, that's the default. $ods_doc->updateCell($sheet, 0, 0, "The title of the column"); # Even though we're writing a number, it will be escaped # as a string because we haven't change the format of # the cell. $ods_doc->updateCell($sheet, 1, 0, 2); $ods_doc->updateCell($sheet, 2, 0, 12); $ods_doc->save; #### # &c as above. my $cell = $ods_doc->getCell($sheet, 1, 0); $ods_doc->cellValueType($cell, 'float'); $ods_doc->updateCell($sheet, 1, 0, 2); $cell = $ods_doc->getCell($sheet, 2, 0); $ods_doc->cellValueType($cell, 'float'); $ods_doc->updateCell($sheet, 2, 0, 12); $ods_doc->save;