jolasa has asked for the wisdom of the Perl Monks concerning the following question:

Lite.pm is inserting this text into my data:

Win32::OLE(0.1701): GetOleObject() Not a Win32::OLE object at C:/Perl/site/lib/Win32/OLE/Lite.pm line 155 during global destruction.

How do I stop this?

Can I just remove Lite.pm?

Jon

Replies are listed 'Best First'.
Re: Lite.pm Causing Problems
by jcb (Parson) on Sep 05, 2019 at 23:04 UTC

    No, nor will applying undef to your globals fix the problem. The problem is that, somewhere in your code, a Win32::OLE object handle is getting corrupted, and the destructor in Win32::OLE::Lite is finding that a resource it is supposed to release is not there and complaining about this state of affairs.

    That the warning is getting into your data means that you should consider explicitly writing your data to a file instead of redirecting the script's output. You will still get this warning until you fix the underlying problem, but it will no longer be mixed into your data.

    A SSCCE would also be very helpful, as the lack of information in your question required me to make some guesses in the above answer.

      jcb: No, nor will applying undef to your globals fix the problem. The problem is that, somewhere in your code, a Win32::OLE object handle is getting corrupted, and the destructor in Win32::OLE::Lite is finding that a resource it is supposed to release is not there and complaining about this state of affairs.

      So you havent heard of global destruction phase? Super Search cures what ails ya

        Using undef will merely move the error from the end of the output to the middle of the output. The DESTROY method will be called at some time, and the only solution is to ensure that the object is valid when it is called.

        A small addition: if the corruption is occurring due to the undefined order in which global destruction is carried out, releasing the last reference prior to global destruction will resolve the problem. But you do not know that that is the case — there could be a bug in the questioner's program that is corrupting the object or global destruction may be trashing it before destroying Win32::OLE::Lite. You. Do. Not. Know. Which. Is. Happening. Here.

Re: Lite.pm Causing Problems
by Anonymous Monk on Sep 05, 2019 at 18:43 UTC