How can I fire and forget a process in Perl?

后端 未结 4 1610
慢半拍i
慢半拍i 2020-11-27 21:45

Can somebody please tell me how to fire-and-forget a process in Perl? I\'ve already looked at ruby: how to fire and forget a subprocess? for doing the same in Ruby.

4条回答
  •  天命终不由人
    2020-11-27 22:31

    If you want the watchdog "child" process to go away when the "parent" process exits then you don't really want the parent process to "fire and forget" the child process. You either need to fork (as described by brian d foy) or pass the PID of the parent to the child (so the latter can poll the process table - not recommended).

提交回复
热议问题