in reply to Re^2: Win32:OLE - close documents
in thread Win32:OLE - close documents

I think it may be that your application variable ($doc in your original example) doesn't go out of scope before the global destruction phase. So the WINWORD.EXE instance hangs around until you do

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