undef $doc;
like Corion said, or if $doc is a lexical and leaves it's scope.
I have had problems with Win32::OLE variables being destroyed during global destruction. The ordering seems to mess things up enough to confuse Win32::OLE.
/J
In reply to Re^3: Win32:OLE - close documents
by jplindstrom
in thread Win32:OLE - close documents
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |