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

Hello revered PerlMonks

I am running EPIC Perl debugging plugin on Eclipse. (It's a development environment).

I am running DWIM Perl: Strawberry Perl 5.14.2.1 on Windows 7, Eclipse version 3.7.1 build M20110909-1335, EPIC version 0.6.44

It turns out that at the start of the debugging session, the following warning is printed at the Console:

Win32::OLE operating in debugging mode: _Unique => 1 at F:/Win7programs/Dwimperl/perl/vendor/lib/Win32/OLE/Lite.pm line 30 require Win32/OLE/Lite.pm called at F:/Win7programs/Dwimperl/perl/ +vendor/lib/Win32/OLE.pm line 48 require Win32/OLE.pm called at E:/My Documents/Technical/Perl/Ecli +pse workspace/Project/StatementExcel.pm line 28 StatementExcel::BEGIN() called at F:/Win7programs/Dwimperl/perl/ve +ndor/lib/Win32/OLE/Lite.pm line 0 eval {...} called at F:/Win7programs/Dwimperl/perl/vendor/lib/Win3 +2/OLE/Lite.pm line 0 require StatementExcel.pm called at E:/My Documents/Technical/Perl +/Eclipse workspace/Project/My Perl script.pl line 16 main::BEGIN() called at F:/Win7programs/Dwimperl/perl/vendor/lib/W +in32/OLE/Lite.pm line 0 eval {...} called at F:/Win7programs/Dwimperl/perl/vendor/lib/Win3 +2/OLE/Lite.pm line 0

Once the script runs, it runs with no problems.

The same warning shows up too if I switch to Active Perl.

What's its meaning? Can it be safely ignored? Can it be fixed/eliminated?

"My perl script.pl" is my main Perl script, StatementExcel.pm is a package I wrote.

TIA

HelenCr

Replies are listed 'Best First'.
Re: Warning: "Win32::OLE operating in debugging mode: _Unique => 1"
by Corion (Patriarch) on Jun 24, 2012 at 16:10 UTC

    This is likely a (bad/weird) side effect of your development environment. Try running your program outside of Eclipse.

    Looking at the distribution, the code for generating this message is (in Win32::OLE::Lite, as even the warning messages in your screendump say)

    if (defined &DB::sub && !defined $_Unique) { warn "Win32::OLE operating in debugging mode: _Unique => 1\n"; $_Unique = 1; }

    So it would seem that Eclipse defines &DB::sub, which makes Win32::OLE::Lite generate this message.

      Thank you, Corion. So you mean: Eclipse defines &DB::sub, but neglects to define: "$_Unique"?

      What is $_Unique? Is it a known global variable?

        Have you looked at what the Win32::OLE documentation has to say about _Unique? I don't see how I could provide more information than what its author wrote on the subject.

        So you mean: Eclipse defines &DB::sub, but neglects to define: "$_Unique"?

        It seems so. Eclipse has no idea of what Win32::OLE does, and it definitively should not mess with the internals of Win32::OLE. It's worse enough that Eclipse messes with perl at all. It uses some debugger hooks, one of them is &DB::sub (documented in perldebguts). One could discuss if it should do so, but it makes some sense if you want to single-step a perl program from within Eclipse. Win32::OLE also uses debugger hooks. But Win32::OLE is no debugger, not even remotely. It does so because there seems to be no other way to get some information. This is not nice, and the only way to prevent this collision is seems to be to use either Eclipse or Win32::OLE, but not both. You can still write perl code in Eclipse, but use a clean perl from outside Eclipse to run your code. On Windows, a double click on the *.pl file may be sufficient, else open a command prompt and type perl yourscript.pl.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)