Reputation: 2951
I would like to spawn a child process in XP; for example:
system "start", "cmd.exe", "perl", "child.pl", "arg1";
When I run this, it tells me that "start doesn't exist." (Start works in Win 7).
When I run:
system "cmd.exe", "perl", "child.pl", "arg1";
The child process occurs in the same console as the parent process and upon completion the console session ends--so, I believe that the child simply takes over and the parent dies.
Normally, when I run these commands in Win 7, a new console appears and everything works fine.
When I type:
"start"
into the XP console, a new console appears--why can it find it then, but not when I call it from within a Perl script???
I've tried Win::Process
and Win::Job
to no avail: it still just kills the parent and starts the child, the whole tree dying upon completion.
Banging my head against this. Does anyone have a sure fire way to create an independent child process in XP (and not with fork
).
Upvotes: 0
Views: 83
Reputation: 9819
Start is a built-in in cmd.exe, try system('cmd.exe /c "start perl child.pl arg1"')
.
Upvotes: 2