IPC::Open3 - Open a Process for Reading, Writing, and Error Handling
use IPC::Open3; $pid = open3($WTR, $RDR, $ERR, $cmd_with_args); $pid = open3($WTR, $RDR, $ERR, $cmd, "arg1", "arg2", ...);
IPC::Open3 works like IPC::Open2, with the following differences:
- The first two arguments (
$WTRand$RDR) are given in reverse order compared to IPC::Open2. - A third filehandle can be given, for standard error. If this argument is given as
"", thenSTDERRandSTDOUTfor$cmdwill be on the same filehandle. - If
$WTRbegins with<&, then the leading<&is stripped from the name and the remainder is assumed to be a regular filehandle for an open file, rather than a reference to a typeglob.open3()opens this file asSTDINfor$cmdand closes it in the parent. Likewise, if$RDRor$ERRbegins with>&, then$cmddirectsSTDOUTorSTDERRdirectly to that file rather than to the parent.
Warnings given for IPC::Open2 regarding possible program hangs apply to IPC::Open3 as well.