Win32::OLE::Const startup delay
monarch
created: 2006-03-05 19:22:03
I am experiencing a long (approx 1 minute) delay when compiling or running a script that uses Win32::OLE::Const.

Running perl -wc mytest.pl takes approximately 1 minute 20 seconds to respond. My machine is a Hewlett-Packard WinXP professional running ActiveState Perl v5.8.7 with MSWin32-x86-multi-thread (Binary build 813). Pentium 4 2.8GHz, 504MB RAM.

During the delay there is almost no CPU being used.. so something could be blocking? Several months ago this would run with almost no delay. The script below compiles instantly when commenting out the line using Win32::OLE::Const.

Here is the code of mytest.pl:

use Win32::OLE;
use Win32::OLE::Const 'Microsoft Office';

Re: Win32::OLE::Const startup delay
created: 2006-03-05 19:52:37

Hi,monarch. I tried your script, and it compiled immediately, giving me a "syntax OK" message. I'm running the same version of Perl as you are, under XP Home, with a slower CPU but more memory. I'm having trouble imagining what might be causing the delay without burning cycles. Do you notice much disk activity? Do you have Microsoft products open that may somehow affect the script? Would there be any reason for something to time out, without showing any error?

I suppose the next question is, what is different now, than was in effect several months ago? New software, updates of perl or modules, etc.?

Re^2: Win32::OLE::Const startup delay
created: 2006-03-05 20:19:04
There's a line in:
  $PerlDir\site\lib\Win32\OLE\Const.pm
that reads
  __PACKAGE__->_Typelibs;

If I comment out this line then it loads instantly, if I uncomment this line, then I get my delay.

Update: it appears that _Typelibs() is defined in

  site\lib\auto\Win32\OLE\OLE.dll
Re: Win32::OLE::Const startup delay
created: 2006-03-08 03:20:32
I encountered the same problem in DBD::ADO::Const:
  It seems that all available type libraries are checked
  (for whatever reason). In a networking environment, the
  performance may be unacceptable.

  http://search.cpan.org/~sgoeldner/DBD-ADO-2.95/lib/DBD/ADO/Const.pm
and implemented an alternative to Win32::OLE::Const.

perlmonks.org content © perlmonks.org and Anonymous Monk, monarch, spiritway

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03