How can I redirect standard output to a file in Perl?

后端 未结 5 1630
青春惊慌失措
青春惊慌失措 2020-12-17 18:07

I\'m looking for an example of redirecting stdout to a file using Perl. I\'m doing a fairly straightforward fork/exec tool, and I want to redirect the child\'s output to a f

5条回答
  •  感动是毒
    2020-12-17 18:24

    The child itself can do select $filehandle to specify that all of its print calls should be directed to a specific filehandle.

    The best the parent can do is use system or exec or something of the sort to do shell redirection.

提交回复
热议问题