|my $runner = IPC::Open3::Simple-><B>newB>(in => \&sub_in, out => \&sub_out, err => \&sub_err)||Return an object that run commands. Takes no arguments or a hash containing one or more of the keys in, out and err. The values of those keys are function references (see method run for details).|
Execute the shell commands @cmds. @cmds follows the same syntax as the command
arguments of open3 from IPC::Open3.
run creates a process that executes thoses commands, and connects the processs stdin, stdout and stderr to the functions passed in the constructor:
If out was defined in new, every line coming from the processs stdout is passed as first argument to the function reference sub_out. The line is chomped.
If err was defined, the same applies, with lines from the processs stderr being passed to sub_err.
If in was defined, sub_in is called with a filehandle as first argument. Everything written to this filehandle will be sent forward to the processs stdin. sub_in is responsible for calling close() on the filehandle.
run returns only when the command has finished to run.
IPC::Open3::Simple::new expects coderefs You called new with in, err or out arguments that are not function references. ERROR: failed to execute command... Open3 failed to run the command passed in @cmds to run.
No bugs so far.
Limitation: IPC::Open3::Simple is not designed for interactive interprocess communication. Do not use it to steer the process opened by open3 via stdin/stdout/stderr, use fork and pipes or some appropriate IPC module for that. IPC::Open3::Simples scope is to easily run a command, eventually with some stdin input, and get its stdout and stderr along the way, not to interactively communicate with the command.
See IPC::Open3, IPC::Run, IPC::Cmd.
Copyright (C) by Erwan Lemonnier <email@example.com>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
|perl v5.20.3||IPC::OPEN3::SIMPLE (3)||2006-07-20|