How do you capture stderr, stdout, and the exit code all at once, in Perl?

后端 未结 6 2203
情深已故
情深已故 2020-11-27 03:19

Is it possible to run an external process from Perl, capture its stderr, stdout AND the process exit code?

I seem to be able to do combinations of these, e.g. use ba

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 03:55

    If you're getting really complicated, you might want to try Expect.pm. But that's probably overkill if you don't need to also manage sending input to the process as well.

提交回复
热议问题