How to launch program from Perl as a separate process? [duplicate]

人走茶凉 提交于 2020-01-06 03:22:14

问题


Possible Duplicate:
How can I fire and forget a process in Perl?

I'm looking for a way to invoke a new process from a Perl script, that will let a launched program and a Perl script, from which it's launched, proceed to work concurrently.

The program is SIPp, if it's important.

Thank you.


回答1:


If you actually want separate processes, then another option is fork and exec.

if (fork) {
  # In the parent program
  # Continue as usual
  ...
} else {
  # In the new child program
  # Replace with another program
  exec $some_other_program;
}



回答2:


SIPp has "-bg" commandline parameter.

This parameter launches SIPp in background mode.




回答3:


Use Proc::Background




回答4:


In Windows system you may use "start" command.

For example:

start notepad

OR

start /d"C\Program Files\Sipp3.1" sipp.exe -sn uac



来源:https://stackoverflow.com/questions/8240483/how-to-launch-program-from-perl-as-a-separate-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!