Proc::Class - OO interface for process management
use Test::More tests => 4; use Proc::Class; my $script = Proc::Class->spawn( cmd => '/path/to/script/qmail/foo.pl', env => {DEFAULT => "TOKEN"}, argv => [qw/--dump/], ); $script->print_stdin($mail->body); $script->close_stdin(); is $script->slurp_stdout(), ''; is $script->slurp_stderr(), ''; my $status = $script->waitpid; ok $status->is_exited(); is $status->exit_status(), 0;
Proc::Class is a simple OO wrapper for IPC::Open3, POSIX.pm, and more.
THIS MODULE IS IN ITS BETA QUALITY. THE API MAY CHANGE IN THE FUTURE
create a new script object.
pass $txt to child process' STDIN
close child process' *STDIN.
slurp() from child process' *STDOUT.
slurp() from child process' *STDERR.
Waits for a particular child process to terminate and returns the pid of the deceased process. Returns Proc::Class::Status object.
Send signal to the process.
Tokuhiro Matsuno <tokuhirom slkjfd gmail.com>
Proc::Open3
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Proc::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proc::Class
CPAN shell
perl -MCPAN -e shell install Proc::Class
For more information on module installation, please visit the detailed CPAN module installation guide.