| 1 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use 5.042; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | package IO::Async::Open3::Simple::Process 0.01 { | |||||||||
| 5 | |||||||||||
| 6 | # ABSTRACT: Process run using IO::Async::Open3::Simple | ||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | sub new ( $class, $pid, $stdin ) { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 10 | 1 | bless { pid => $pid, stdin => $stdin, user => '' }, $class; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | sub pid ($self) { $self->{pid} } | ||||||||
|
Subroutine
pid: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | if ( $^O eq 'MSWin32' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | require Carp; | |||||||||
| 19 | 0 | ▶ | *print = sub (@) { Carp::croak("IO::Async::Open3::Simple::Process#print is unsupported on this platform") }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | 0 | ▶ | *say = sub (@) { Carp::croak("IO::Async::Open3::Simple::Process#say is unsupported on this platform") }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 21 | } else { | ||||||||||
| 22 | 0 | ▶ | *print = sub ( $self, @data ) { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 23 | 0 | my $stdin = $self->{stdin}; | |||||||||
| 24 | 0 | print $stdin @data; | |||||||||
| 25 | 1 | }; | |||||||||
| 26 | 0 | ▶ | *say = sub ( $self, @data ) { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 27 | 0 | my $stdin = $self->{stdin}; | |||||||||
| 28 | 0 | print $stdin @data, "\n"; | |||||||||
| 29 | 1 | }; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub close ($self) { | ||||||||
|
Subroutine
close: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 34 | 0 | CORE::close( $self->{stdin} ); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | 3 | ▶ | sub user ( $self, $data = undef ) { | ||||||||
|
Subroutine
user: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 39 | 3 | ▶ | $self->{user} = $data if defined $data; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 3 | $self->{user}; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||