DESCRIPTION

This class enable you to fork a child process and "read" and "write" data to. You can also send signals to the child and see when the process ends. The child process can be an external program (bash, telnet, ffmpeg, ...) or a CODE block running perl.

Patches that enable the "read" event to see the difference between STDERR and STDOUT are more than welcome.

EVENTS

close

$self->on(close => sub { my ($self, $exit_value, $signal) = @_; });

Emitted when the child process exit.

error

$self->on(error => sub { my ($self, $str) = @_; });

Emitted when when the there is an issue with creating, writing or reading from the child process.

fork

$self->on(fork => sub { my ($self) = @_; });

Emitted after fork() has been called. Note that the child process might not yet have been started. The order of things is impossible to say, but it's something like this:

This means that the code is subject for shell injection unless invoked with more than one argument. This is considered a feature, but something you should be avare of. See also "exec" in perlfunc for more details.

env

Passing in env will override the default set of environment variables, stored in %ENV.

conduit

Either "pipe" (default) or "pty". "pty" will use IO::Pty to simulate a "pty", while "pipe" will just use "pipe" in perlfunc. This can also be specified by using the "conduit" attribute.