The documentation for Spreadsheet::WriteExcel says:
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:
- If my() was not used to declare the scope of a workbook variable created using new().
- If the new(), add_worksheet() or add_format() methods are called in subroutines.
The reason for this is that Spreadsheet::WriteExcel relies on Perl's DESTROY mechanism to trigger destructor methods in a specific sequence. This may not happen in cases where the Workbook, Worksheet and Format variables are not lexically scoped or where they have different lexical scopes.
In reply to Re: Help adding a worksheet in a subroutine with Spreadsheet::WriteExcel
by kyle
in thread Help adding a worksheet in a subroutine with Spreadsheet::WriteExcel
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |