in reply to Global variables issue in spreadsheets
When your workbook variable is not declared with my, you need to explicitly close the workbook.
$workbook->close();Spreadsheet::WriteExcel says:
An explicit close() is required if the file must be closed prior to performing some external action on it such as copying it, reading its size or attaching it to an email. In addition, close() may be required to prevent perl's garbage collector from disposing of the Workbook, Worksheet and Format objects in the wrong order. Situations where this can occur are:
|
|---|