The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

AnyEvent::Open3::Simple::Process - Process run using AnyEvent::Open3::Simple

VERSION

version 0.79

DESCRIPTION

This class represents a process being handled by AnyEvent::Open3::Simple.

ATTRIBUTES

pid

 my $pid = $proc->pid;

Return the Process ID of the child process.

METHODS

print

 $proc->print(@data);

Write to the subprocess' stdin.

Be careful to use either the stdin attribute on the AnyEvent::Open::Simple object or this print methods for a given instance of AnyEvent::Open3::Simple, but not both! Otherwise bad things may happen.

Currently on (non cygwin) Windows (Strawberry, ActiveState) this method is not supported, so if you need to send (standard) input to the subprocess, use the stdin attribute on the AnyEvent::Open::Simple constructor.

say

 $proc->say(@data);

Write to the subprocess' stdin, adding a new line at the end. This functionality is unsupported on Microsoft Windows.

Be careful to use either the stdin attribute on the AnyEvent::Open::Simple object or this say methods for a given instance of AnyEvent::Open3::Simple, but not both! Otherwise bad things may happen.

Currently on (non cygwin) Windows (Strawberry, ActiveState) this method is not supported, so if you need to send (standard) input to the subprocess, use the stdin attribute on the AnyEvent::Open::Simple constructor.

close

 $proc->close

Close the subprocess' stdin.

user

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({ message => 'hello there' });
   },
   on_stdout => sub {
     my($proc) = @_;
     say $proc->user->{message};
   },
 );

AUTHOR

author: Graham Ollis <plicease@cpan.org>

contributors:

Stephen R. Scaffidi

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 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.