This is not much a Perl-ish answer, but I guess it's not mostly a Perl problem - this is probably because of the threading model the object is running under. I have come across the same problem with VisualBasic and JavaScript object creation, and I have found that, to obtain different and separate independent copies, you can:
- Create an object of type WScript.Shell
- Call the "run" method on it to launch a separate browser (or whatever program you need to run)
This is a sample, just not to go completely off-topic and being thrown out of the monastery for messing with the Enemy without providing appropriate Perl code as an offer:
use Win32::OLE;
my $url = 'http://www.perlmonks.com/index.pl?node_id=';
# opens five separate instances
for (my $i = 0; $i < 5; $i++ ) {
my $node_id = 300000 + $i;
$obSh = Win32::OLE->new('WScript.Shell');
$rc = $obSh->run("IEXPLORE.EXE ${url}${node_id}", 1, false);
undef $obSh;
}
On my Windows box, each copy of explorer is independent and separately prompts for the proxy password.
You might want to read this too.
-
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.
|