Perl timeout command in windows and linux
问题 I'm writing a perl script that needs to work in windows and linux that will run a process, timeout if it takes too long, return the exit code assuming it didn't timeout, and return stdout assuming the exitcode was zero and it didn't timeout. I don't need STDIN or STDERR. I've tried to use IPC::run but couldn't get it to work. The closest I got is with IPC::Open3 and waitpid($pid, WNOHANG) . But I've hit a snag. I'm seeing different results on windows and linux. In the code below I give open3