Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Help adding a worksheet in a subroutine with Spreadsheet::WriteExcel

by ferreira (Chaplain)
on Jan 05, 2007 at 18:54 UTC ( [id://593194]=note: print w/replies, xml ) Need Help??


in reply to Help adding a worksheet in a subroutine with Spreadsheet::WriteExcel

You may have said that you posted too early and that calling close() is the answer to your problem, but it is indeed a mistery documented in the entry for close() in Spreadsheet::WriteExcel.

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.

This is basically a bug, I think. The implementation probably use weak references or something similar which allows objects to be disposed without a discipline needed for correctly handling composite objects. The invoking of close() is the documented workaround.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://593194]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found