I have an existing problem with Perl/OLE, that I'd like you to take a look at.
In my script there is a call to:
Win32::OLE->new( 'InternetExplorer.Application', sub {$_[0]->Quit;} )
It appears that the behavior of Win32::OLE->new is as follows:
- If there is an existing instance of InternetExplorer(IE) running, then it will return a handle to the existing IE application.
- If there is not an existing instance of IE running, then it will create a new instance of IE, and return a handle to this new instance.
I seem to be having a concurrency/race condition problem with this call, when multiple scripts get the same instance of IE for the handle. Can you help me to find a way to change this call, so that it ALWAYS returns a new instance of IE and does not try to look for an already existing instance of IE?
Note: I am currently using Win32::Mutex to avoid the concurrency/race condition problems. However, this is not the best solution.
Thanks!
update (broquaint): tidied up formatting
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|