perl - 想要在Perl脚本中执行Perl脚本

标签 perl process exec fork

我需要有关perl的帮助。我是新来的。
我想从我的父perl脚本执行一个perl脚本,并涉及以下情形:

if (my child script takes more time than my time limit)
{
    I need to kill the child script with a return code 
    logged into my parent script log file
}

if (my child script failed to execute)
{
     I need to write a new RC to my parent script logfile 
     by looking at my child script exit status
} 

任何机构都可以为此提供代码,例如如何使用fork,exec和处理相关命令
执行父脚本时获取子进程的ID?

最佳答案

perlipc(进程间通信)手册页将是一个不错的起点。

关于perl - 想要在Perl脚本中执行Perl脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6900816/

相关文章:

c++ - windows EnumProcesses 某些进程名称为 <unknown>

Python 执行和 __name__

perl - 从 Perl 中的输出记录

perl - Perl 在哪里存储它的中间字节码?

windows - 由 : java.net.BindException 引起:地址已在使用中:绑定(bind)

c++ - 构建进程控制守护进程 (PCD) 时出错

exec - 在 Swift 中调用外部命令

windows - 与 bash 的 exec() 等效的 PowerShell 是什么?

perl - 如何从在 Ubuntu 上运行的 Simulink Standalone 可执行文件传递输入参数和记录输出

regex - 用成对的分隔符封闭仍未封闭的字符串