AnyEvent::Open3::Simple::Process - Process run using AnyEvent::Open3::Simple
version 0.90
This class represents a process being handled by AnyEvent::Open3::Simple.
my $pid = $proc->pid;
Return the Process ID of the child process.
$proc->print(@data);
Write to the subprocess' stdin.
Do NOT use this method if you have passed stdin via the $stdin
argument on the AnyEvent::Open3::Simple#run method.
Currently on (non cygwin) Windows (Strawberry, ActiveState) this method is not supported, so if you need to send (standard) input to the subprocess, you must pass it into the AnyEvent::Open3::Simple#run method.
$proc->say(@data);
Write to the subprocess' stdin, adding a new line at the end.
Do NOT use this method if you have passed stdin via the $stdin
argument on the AnyEvent::Open3::Simple#run method.
Currently on (non cygwin) Windows (Strawberry, ActiveState) this method is not supported, so if you need to send (standard) input to the subprocess, you must pass it into the AnyEvent::Open3::Simple#run method.
$proc->close
Close the subprocess' stdin.
Version 0.77
$proc->user($user_data); my $user_data = $proc->user;
Get or set user defined data tied to the process object. Any Perl data structure may be used. Useful for persisting data between callbacks, for example:
AnyEvent::Open3::Simple->new( on_start => sub { my($proc) = @_; $proc->user({ prefix => '> ' }); }, on_stdout => sub { my($proc, $line) = @_; my $prefix = $proc->user->{prefix}; say "$prefix$line"; }, );
Author: Graham Ollis <plicease@cpan.org>
Contributors:
Stephen R. Scaffidi
Scott Wiersdorf
Graham Knop (HAARG)
This software is copyright (c) 2012-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.