in reply to Global Variable for Worksheet?
The difference is that if the object is in a lexical variable, the DESTROY method is called when it goes out of scope (and no other refereeneces to it exist). This happens at the end of the program. It seems that Spreadsheet::Write uses that to actually write its output file.
Other methods to trigger it is to remove all references to the object. For example you could add $h = undef at the end of your program.
But do consider using lexical variables wherever possible, they usually make life easier.
|
|---|