IPC/Open3

Section: Perl Programmers Reference Guide (3)
Updated: perl 5.003 with
Index Return to Main Contents
 

NAME

IPC::Open3, open3 - open a process for reading, writing, and error handling  

SYNOPSIS

    $pid = open3(\*WTRFH, \*RDRFH, \*ERRFH 
                    'some cmd and args', 'optarg', ...);


 

DESCRIPTION

Extremely similar to open2(), open3() spawns the given $cmd and connects RDRFH for reading, WTRFH for writing, and ERRFH for errors. If ERRFH is `', or the same as RDRFH, then STDOUT and STDERR of the child are on the same file handle.

If WTRFH begins with ``<&'', then WTRFH will be closed in the parent, and the child will read from it directly. If RDRFH or ERRFH begins with ``>&'', then the child will send output directly to that file handle. In both cases, there will be a dup(2) instead of a pipe(2) made.

If you try to read from the child's stdout writer and their stderr writer, you'll have problems with blocking, which means you'll want to use select(), which means you'll have to use sysread() instead of normal stuff.

All caveats from open2() continue to apply. See the open2 manpage for details.


 

Index

NAME
SYNOPSIS
DESCRIPTION

This document was created by man2html, using the manual pages.
Time: 15:34:43 GMT, January 15, 2023