如何从Perl运行一个进程并捕获输出和返回代码? [英] How can I run a process from Perl and capture both output and return code?
本文介绍了如何从Perl运行一个进程并捕获输出和返回代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Perl(命令行PHP脚本)中运行一个单独的进程.我想捕获此过程的输出并返回代码. (可选)我希望能够终止该过程并继续进行,如果该过程花费的时间超过N秒.我应该看什么?
I would like to run a separate process in Perl (a command line PHP script). I would like to capture this processes output AND return code. Optionally I would like to be able to terminate the process and move on if the process takes longer than N seconds. What should I look into?
推荐答案
查看全文