-4
下面是我的代碼:的Perl:方法寫,write_string不工作
use Spreadsheet::WriteExcel;
my @worksheet ;
my($server_count) = 0;
my($row) = 0;
$worksheet[$server_count] = $workbook->addworksheet("Break Summary");
$worksheet[$server_count]->set_column(0, 0, 60);
$worksheet[$server_count]->set_column(1, 1, 20);
$worksheet[$server_count]->write_string($row, 0, "PositionsSTB" ,$summary_title_format);
$worksheet[$server_count]->write_string(++$row, 0, "Number of distinct accounts breaking" ,$general_format);
&log_info ("\nPOS 0 $break_summary_excel_results[0]");
$worksheet[$server_count]->write_number($row, 1, $break_summary_excel_results[0] ,$general_format);
它打印的信息進行記錄,但沒有到Excel中。
那實際上是你的代碼嗎?它會給出一個錯誤,因爲你從來沒有分配任何東西到$ workbook – ikegami
不,我有它︰my $ workbook = Spreadsheet :: WriteExcel-> new($ gloss_audit。$ file_name); – user2843135