IPC::Run3 - run a subprocess with input/ouput redirection

Edit Package perl-IPC-Run3

This module allows you to run a subprocess and redirect stdin, stdout, and/or stderr to files and perl data structures. It aims to satisfy 99% of the need for using system, qx, and open3 with a simple, extremely Perlish API.

Speed, simplicity, and portability are paramount. (That's speed of Perl code; which is often much slower than the kind of buffered I/O that this module uses to spool input to and output from the child command.)
run3($cmd, $stdin, $stdout, $stderr, \%options)

All parameters after $cmd are optional.

The parameters $stdin, $stdout and $stderr indicate how the child's corresponding filehandle (STDIN, STDOUT and STDERR, resp.) will be redirected. Because the redirects come last, this allows STDOUT and STDERR to default to the parent's by just not specifying them -- a common use case.

run3 throws an exception if the wrapped system call returned -1 or anything went wrong with run3's processing of filehandles. Otherwise it returns true. It leaves $? intact for inspection of exit and wait status.

Note that a true return value from run3 doesn't mean that the command had a successful exit code. Hence you should always check $?.

See "%options" for an option to handle the case of system returning -1 yourself.
$cmd

Refresh
Refresh
Source Files
Filename Size Changed
IPC-Run3-0.042.tar.gz 0000019253 18.8 KB
perl-IPC-Run3.spec 0000002590 2.53 KB
Latest Revision
Holger Manthey's avatar Holger Manthey (csbuild) committed (revision 4)
remove x-flag
Comments 0
openSUSE Build Service is sponsored by