AnyEvent-Subprocess
view release on metacpan or search on metacpan
lib/AnyEvent/Subprocess.pm view on Meta::CPAN
If you are too lazy to look -- there are delegates for giving the
child arbitrary sockets or pipes opened to arbitrary file descriptors
(so you can deal with more than stdin/stdout/stderr and communicate
bidirectionally between the parent and child), there is a delegate for
giving the child a pseudo-tty (which can run complicatged programs,
like emacs!), there is a delegate for capturing any input
automatically, and passing it back to the parent via the C<Done>
object, and there is a delegate for calling functions in the parent
when certain events are received.
Once you have decided what delegates your job needs, you need to
create a job object:
my $proc = AnyEvent::Subprocess->new(
delegates => [qw/List them here/],
code => sub { code to run in the child },
on_completion => sub { code to run in the parent when the child is done },
);
Then you can run it:
( run in 1.101 second using v1.01-cache-2.11-cpan-de7293f3b23 )