[OLE] Problems instantiating a Win32::OLE object near the end of script

2008-01-31 Thread Leblanc, Larry
Hello,

 

Problem Description

 

I am experiencing erratic problems with a Perl script as of late.  When 
attempting to instantiate a Win32::OLE object (CDO.Message) near the end of 
the script (5,000 lines), the script simply ends without any error.  The 
%ERRORLEVEL% at that point has the value -1073741819.

 

Less frequently, the script will either hang or end (once again without error) 
elsewhere in the script.

 

Testing Performed

 

When I attempt to instantiate any other type of non-Win32::OLE object at that 
point in the script, the instantiation succeeds.

 

Enumerating all of the OLE objects just prior to instantiating the new variable 
produces the following:

 

Object=Win32::OLE=HASH(0x32db1a8)   Class=ADODB _Recordset

Object=Win32::OLE=HASH(0x33017f8)   Class=WbemScripting 
ISWbemObjectSet

Object=Win32::OLE=HASH(0x32ddce4)   Class=WbemScripting 
ISWbemObjectEx

Object=Win32::OLE=HASH(0x32ddcb4)   Class=WbemScripting 
ISWbemServicesEx

Object=Win32::OLE=HASH(0x2ca3324)   Class=WbemScripting 
ISWbemServicesEx

Object=Win32::OLE=HASH(0x32dd60c)   Class=WbemScripting 
ISWbemLocator

Object=Win32::OLE=HASH(0x32db184)   Class=ADODB _Recordset

Object=Win32::OLE=HASH(0x32dd2b8)   Class=ADODB _Recordset

Object=Win32::OLE=HASH(0x32da8f0)   Class=ADODB _Connection

 

If, at the beginning of the script, I call the subroutine that instantiates 
this particular object, it works flawlessly!  My gut leads me to believe that 
it is a resource allocation issue.

 

Environment

 

* Windows Server 2003 Standard Edition SP2

* ActivePerl v5.8.8.822

 

What could I use/do to help isolate the problem?  Would I be able to use a 
debugging tool such as Komodo in order to determine if it is indeed a resource 
allocation issue?

 

Thanks,

 

Larry

 



  http://www.cgi.com/ 

Larry LeBlanc
Senior Consultant / Conseiller Principal
B.COMM.(M.I.S.), MCSE/2000, MCSA/2000, MCDBA/2000, CNE-3
Services Web / Web Services
1350, boulevard René-Lévesque ouest
  Bureau 17.710
  Montréal (Québec)
  H3G 1T4
Tel: (514) 415-3000 x5024
  Fax: (514) 415-3987



AVIS DE CONFIDENTIALITÉ / CONFIDENTIALITY NOTICE:

Ce message peut contenir des renseignements confidentiels appartenant 
exclusivement au Groupe CGI Inc. ou à ses filiales. Si vous n'êtes pas le 
destinataire indiqué dans ce message (ou responsable de livrer ce message à la 
personne indiquée ou prévue) ou si vous pensez que ce message vous a été 
adressé par erreur, vous ne pouvez pas utiliser ou reproduire ce message, ni le 
livrer à quelqu'un d'autre. Dans ce cas, vous devez le détruire et vous êtes 
prié d'avertir l'expéditeur en répondant au courriel.

Proprietary Confidential Information belonging to CGI Group Inc. and its 
affiliates may be contained in this message. If you are not a recipient 
indicated or intended in this message (or responsible for delivery of this 
message to such person), or you think for any reason that this message may have 
been addressed to you in error, you may not use or copy or deliver this message 
to anyone else. In such case, you should destroy this message and are asked to 
notify the sender by reply email.

 

image001.gif___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Adding matched files to zip archive

2008-01-31 Thread Mike Gillis
Tseng, Joe [CONTRACTOR] wrote:
 I have mostly figured out how to add files to a zip archive using 
 Archive::Zip::addTreeMatching but I'm getting hung up on what seems to 
 be a subtle point.  I have a line that adds files to an archive 
 directory if they're text or INI files:
  
 $objZip-addTreeMatching( $workingdir, 'config', \.(ini|txt));
  
 But the following line doesn't work for adding what is remaining to 
 another archive directory :
  
 $objZip-addTreeMatching( $workingdir, 'results', !\.(ini|txt));
 I'm sure I'm overlooking something minor; assistance is always greatly 
 appreciated!

Just adding a ! onto the front of a regex doesn't negate it. It's not always 
easy to write negative regexes, but addTree and addTreeMatching support an 
optional variable at the end to do decision-making.

So you can actually use a !, but what you want to do is negate the result of a 
regex, like so:


$objZip-addTree( $workingdir, 'results', sub { !/\.(ini|txt)$/ } );


There, the regex matches *.ini and *.txt, and then the ! (note that it's 
outside of the regex) negates the match.

Also, I added a $, because regexes are always faster when you give it a 
position to start (or end) from.


-- 
Mike Gillis
Languages Development[EMAIL PROTECTED]
ActiveState Software http://www.activestate.com/languages
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs