문제

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).

도움이 되었습니까?

해결책

Start is a built-in in cmd.exe, try system('cmd.exe /c "start perl child.pl arg1"').

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top