alan.swan wrote:
> I think I know what's happening now.
> Correct me if I'm wrong.
> You said that the script stops becos it got replaced by the
> other instance.
> Is that becos the instances share the same script
> (and thus the same name and name space)?
No. What happens is the first script calls 'exec "perl second-script"'. exec
replaces the Perl interpreter running the first script with a new program --
in this case, another Perl interpreter which runs the second script. When
the second script is finished running, you're done. You can't resume the
first script because it doesn't exist in memory any more.
> If this is the reason, would it help if
> I have one script file for each instance?
> (Since I know before hand how many instances I need)
No. The problem is that you are using exec(). You'd never get around to
calling the third script because the code to call the third script is
overwritten by the second script which you exec'ed.
> PS - The other problem I have with using fork() is that
> I am developing on Win32, but the script will be used
> on Unix equivalent eventually.....
This sounds to me as if you think that fork() runs under Win32, but not
under Unix. More like the other way around -- fork() has worked under most
(all?) flavours of Unix for years, but Win32 Perl only got a fork()
emulation in 5.6.
People have been using fork() in Perl for Unix for years.
Cheers,
Philip
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]