use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; ## Write to an existing excel sheet $parser = Spreadsheet::ParseExcel::SaveParser->new(); my $workbook = $parser->Parse('myxls.xls'); # Get the first worksheet. my $worksheet = $workbook->worksheet("myxls"); my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); $worksheet->AddCell( $row_max+1, 0, '10.1' ); $worksheet->AddCell( $row_max+1, 1, '10.2' ); $worksheet->AddCell( $row_max+1, 2, '10.3' ); $worksheet->AddCell( $row_max+1, 3, '10.4' ); $worksheet->AddCell( $row_max+1, 4, '10.5' ); $worksheet->AddCell( $row_max+1, 5, '10.6' ); $worksheet->AddCell( $row_max+1, 6, '10.7' ); $worksheet->AddCell( $row_max+1, 7, '10.8' ); $worksheet->AddCell( $row_max+1, 8, '10.9' ); $workbook->SaveAs('myxls.xls'); ## Excel Read $parser = Spreadsheet::ParseExcel::SaveParser->new(); my $workbook = $parser->Parse('myxls.xls'); # Get the first worksheet. my $worksheet = $workbook->worksheet("myxls"); my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for($r=$row_min; $r<=$row_max; $r++){ for($c=$col_min; $c<=$col_max; $c++){ $d = $worksheet->get_cell( $r, $c); if(defined $d) { $d= $d->unformatted(); print "-$d-\t";} } print "\n"; }