blib/lib/Sys/Cmd.pm

filter: Statementstmt 88.4% 275 / 311 Branchbran 64.6% 115 / 178 Conditioncond 53.0% 53 / 100 MC/DCmcdc 22.2% 12 / 54 Subroutinesub 80.3% 41 / 51 Podpod 78.5% 11 / 14 totaltotal 71.6% 507 / 708 CC 136 SCAR 25.7
CC
136
Cov
75%
_NEW
34.1
mock
30.0
_fastspawn
20.8
CRAP 13.1
↑ Summary blib/lib/Sys/Cmd/Process.pm »
1 package Sys::Cmd;
2 2 ▶use v5.18;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶no warnings "experimental::lexical_subs";
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use feature 'lexical_subs';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Carp qw[];
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Cwd qw[getcwd];
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Encode::Locale qw[$ENCODING_LOCALE]; # Also Creates the 'locale' alias
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Encode qw[encode resolve_alias];
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use IO::Handle qw[];
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Log::Any qw[$log];
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use Proc::FastSpawn qw[];
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use Sys::Cmd::Process;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use Exporter::Tidy _map => {
Subroutine BEGIN: called CC=1 SCAR=2.2
17 5 ▶ run => sub { _syscmd( undef, @_ )->_run },
Subroutine __ANON__: called CC=1 SCAR=0.0
18 33 ▶ spawn => sub { _syscmd( undef, @_ )->_spawn },
Subroutine __ANON__: called CC=1 SCAR=0.0
19 1 ▶ syscmd => sub { _syscmd( undef, @_ ) },
Subroutine __ANON__: called CC=1 SCAR=0.0
20 0 ▶ runsub => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 0 my $cmd = _syscmd( undef, @_ );
22 0 ▶ sub { @_ ? _syscmd( $cmd, @_ )->_run : $cmd->_run }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
23 0 },
24 0 ▶ spawnsub => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 0 my $cmd = syscmd( undef, @_ );
26 0 ▶ sub { @_ ? _syscmd( $cmd, @_ )->_spawn : $cmd->_spawn }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
27 0 },
28 2 };
29  
30 2 our $VERSION = 'v0.986.3';
31  
32 ### START Class::Inline ### v0.0.1 Thu Dec 11 13:24:56 2025
33 2 require Carp;
34 2 our ( @_CLASS, $_FIELDS, %_NEW );
35  
36 35 ▶sub new {
Subroutine new: called CC=10 SCAR=24.0
Pod undocumented
37 35 my $class = shift;
38 35 ▶ my $CLASS = ref $class || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
0350
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
39 35 ▶ $_NEW{$CLASS} //= do {
Condition66%2/3
$Sys::Cmd::_NEW{$CLASS} //= do { my(%seen, @new, @build); my(@possible) = $CLASS; while (@possible) { my $c = shift @possible; no strict 'refs'; push @new, $c . '::_NEW' if exists &{$c . '::_NEW';}; push @build, $c . '::BUILD' if exists &{$c . '::BUILD';}; ++$seen{$c}; if (exists &{$c . '::DOES';}) { push @possible, grep({not $seen{$_}++;} $c->DOES("*")); } ; push @possible, grep({not $seen{$_}++;} @{$c . '::ISA';}); } ; [[reverse(@new)], [reverse(@build)]] }
l!l&&r!l&&!r
3320
MC/DC0%0/2
$Sys::Cmd::_NEW{$CLASS} //= do { my(%seen, @new, @build); my(@possible) = $CLASS; while (@possible) { my $c = shift @possible; no strict 'refs'; push @new, $c . '::_NEW' if exists &{$c . '::_NEW';}; push @build, $c . '::BUILD' if exists &{$c . '::BUILD';}; ++$seen{$c}; if (exists &{$c . '::DOES';}) { push @possible, grep({not $seen{$_}++;} $c->DOES("*")); } ; push @possible, grep({not $seen{$_}++;} @{$c . '::ISA';}); } ; [[reverse(@new)], [reverse(@build)]] }
$Sys::Cmd::_NEW{$CLASS} do { my(%seen, @new, @build); my(@possible) = $CLASS; while (@possible) { my $c = shift @possible; no strict 'refs'; push @new, $c . '::_NEW' if exists &{$c . '::_NEW';}; push @build, $c . '::BUILD' if exists &{$c . '::BUILD';}; ++$seen{$c}; if (exists &{$c . '::DOES';}) { push @possible, grep({not $seen{$_}++;} $c->DOES("*")); } ; push @possible, grep({not $seen{$_}++;} @{$c . '::ISA';}); } ; [[reverse(@new)], [reverse(@build)]] }
Truth table66%2/3
A //= B
A= $Sys::Cmd::_NEW{$CLASS}B= do { my(%seen, @new, @build); my(@possible) = $CLASS; while (@possible) { my $c = shift @possible; no strict 'refs'; push @new, $c . '::_NEW' if exists &{$c . '::_NEW';}; push @build, $c . '::BUILD' if exists &{$c . '::BUILD';}; ++$seen{$c}; if (exists &{$c . '::DOES';}) { push @possible, grep({not $seen{$_}++;} $c->DOES("*")); } ; push @possible, grep({not $seen{$_}++;} @{$c . '::ISA';}); } ; [[reverse(@new)], [reverse(@build)]] }
ABresult
1X1
011
000
40 2 my ( %seen, @new, @build );
41 2 my @possible = ($CLASS);
42 2 ▶ while (@possible) {
Branch: 1 branch
BranchTrueFalseTotal
if (@possible) 2 2 4
43 2 my $c = shift @possible;
44 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
45 2 ▶ push @new, $c . '::_NEW' if exists &{ $c . '::_NEW' };
Branch: 1 branch
BranchTrueFalseTotal
if exists &{$c . '::_NEW';} 2 0 2
46 2 ▶ push @build, $c . '::BUILD' if exists &{ $c . '::BUILD' };
Branch: 1 branch
BranchTrueFalseTotal
if exists &{$c . '::BUILD';} 0 2 2
47 2 $seen{$c}++;
48 2 ▶ if ( exists &{ $c . '::DOES' } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists &{$c . '::DOES';}) 0 2 2
49 0 push @possible, grep { not $seen{$_}++ } $c->DOES('*');
50 }
51 0 push @possible, grep { not $seen{$_}++ } @{ $c . '::ISA' };
52 }
53 2 [ [ reverse(@new) ], [ reverse(@build) ] ];
54 };
55 35 ▶ my $self = { @_ ? @_ > 1 ? @_ : %{ $_[0] } : () };
Branch: 2 branches
BranchTrueFalseTotal
@_ ? : 35 0 35
@_ > 1 ? : 0 35 35
56 35 bless $self, $CLASS;
57 35 my $attrs = { map { ( $_ => 1 ) } keys %$self };
58 35 map { $self->$_($attrs) } @{ $_NEW{$CLASS}->[0] };
59 {
60 33 local $Carp::CarpLevel = 3;
61 33 Carp::carp("Sys::Cmd: unexpected argument '$_'") for keys %$attrs
62 }
63 0 map { $self->$_ } @{ $_NEW{$CLASS}->[1] };
64 33 $self;
65 }
66  
67 35 ▶sub _NEW {
Subroutine _NEW: called CC=18 SCAR=35.3
68 35 CORE::state $fix_FIELDS = do {
69 2 ▶ $_FIELDS = { @_CLASS > 1 ? @_CLASS : %{ $_CLASS[0] } };
Branch: 1 branch
BranchTrueFalseTotal
@Sys::Cmd::_CLASS > 1 ? : 0 2 2
70 2 ▶ $_FIELDS = $_FIELDS->{'FIELDS'} if exists $_FIELDS->{'FIELDS'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $Sys::Cmd::_FIELDS->{"FIELDS"} 0 2 2
71 };
72 35 ▶ if ( my @missing = grep { not exists $_[0]->{$_} } 'cmd' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@missing) = grep({not exists $_[0]{$_};} "cmd")) 0 35 35
73 0 Carp::croak( 'Sys::Cmd required initial argument(s): '
74 . join( ', ', @missing ) );
75 }
76 35 $_[0]{'cmd'} = eval { $_FIELDS->{'cmd'}->{'isa'}->( $_[0]{'cmd'} ) };
77 35 ▶ delete $_[0]{'cmd'} || Carp::confess( 'Sys::Cmd cmd: ' . $@ ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 35 35
Condition25%1/4
$@ && (delete $_[0]{'cmd'} || Carp::confess('Sys::Cmd cmd: ' . $@))
!ll
350
delete $_[0]{"cmd"} or Carp::confess('Sys::Cmd cmd: ' . $@)
l!l
00
MC/DC0%0/2
$@ && (delete $_[0]{'cmd'} || Carp::confess('Sys::Cmd cmd: ' . $@))
$@ delete $_[0]{"cmd"}
Truth table33%1/3
A && B
A= $@B= delete $_[0]{"cmd"}
ABresult
0X0
100
111
78 11 $_[0]{'dir'} = eval { $_FIELDS->{'dir'}->{'isa'}->( $_[0]{'dir'} ) }
79 35 ▶ if exists $_[0]{'dir'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $_[0]{"dir"} 11 24 35
80 35 ▶ delete $_[0]{'dir'} || Carp::confess( 'Sys::Cmd dir: ' . $@ ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 2 33 35
Condition75%3/4
$@ && (delete $_[0]{'dir'} || Carp::confess('Sys::Cmd dir: ' . $@))
!ll
332
delete $_[0]{"dir"} or Carp::confess('Sys::Cmd dir: ' . $@)
l!l
02
MC/DC0%0/2
$@ && (delete $_[0]{'dir'} || Carp::confess('Sys::Cmd dir: ' . $@))
$@ delete $_[0]{"dir"}
Truth table66%2/3
A && B
A= $@B= delete $_[0]{"dir"}
ABresult
0X0
100
111
81 $_[0]{'encoding'} =
82 0 eval { $_FIELDS->{'encoding'}->{'isa'}->( $_[0]{'encoding'} ) }
83 33 ▶ if exists $_[0]{'encoding'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $_[0]{"encoding"} 0 33 33
84 33 ▶ delete $_[0]{'encoding'} || Carp::confess( 'Sys::Cmd encoding: ' . $@ )
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 33 33
Condition25%1/4
$@ && (delete $_[0]{'encoding'} || Carp::confess('Sys::Cmd encoding: ' . $@))
!ll
330
delete $_[0]{"encoding"} or Carp::confess('Sys::Cmd encoding: ' . $@)
l!l
00
MC/DC0%0/2
$@ && (delete $_[0]{'encoding'} || Carp::confess('Sys::Cmd encoding: ' . $@))
$@ delete $_[0]{"encoding"}
Truth table33%1/3
A && B
A= $@B= delete $_[0]{"encoding"}
ABresult
0X0
100
111
85 if $@;
86 19 $_[0]{'env'} = eval { $_FIELDS->{'env'}->{'isa'}->( $_[0]{'env'} ) }
87 33 ▶ if exists $_[0]{'env'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $_[0]{"env"} 19 14 33
88 33 ▶ delete $_[0]{'env'} || Carp::confess( 'Sys::Cmd env: ' . $@ ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 33 33
Condition25%1/4
$@ && (delete $_[0]{'env'} || Carp::confess('Sys::Cmd env: ' . $@))
!ll
330
delete $_[0]{"env"} or Carp::confess('Sys::Cmd env: ' . $@)
l!l
00
MC/DC0%0/2
$@ && (delete $_[0]{'env'} || Carp::confess('Sys::Cmd env: ' . $@))
$@ delete $_[0]{"env"}
Truth table33%1/3
A && B
A= $@B= delete $_[0]{"env"}
ABresult
0X0
100
111
89 0 $_[0]{'mock'} = eval { $_FIELDS->{'mock'}->{'isa'}->( $_[0]{'mock'} ) }
90 33 ▶ if exists $_[0]{'mock'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $_[0]{"mock"} 0 33 33
91 33 ▶ delete $_[0]{'mock'} || Carp::confess( 'Sys::Cmd mock: ' . $@ ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 33 33
Condition25%1/4
$@ && (delete $_[0]{'mock'} || Carp::confess('Sys::Cmd mock: ' . $@))
!ll
330
delete $_[0]{"mock"} or Carp::confess('Sys::Cmd mock: ' . $@)
l!l
00
MC/DC0%0/2
$@ && (delete $_[0]{'mock'} || Carp::confess('Sys::Cmd mock: ' . $@))
$@ delete $_[0]{"mock"}
Truth table33%1/3
A && B
A= $@B= delete $_[0]{"mock"}
ABresult
0X0
100
111
92 33 map { delete $_[1]->{$_} } '_coderef', 'cmd', 'dir', 'encoding', 'env',
93 'err', 'exit', 'input', 'log_any', 'mock', 'on_exit', 'out';
94 }
95  
96 0 ▶sub __RO {
Subroutine __RO: not called CC=1 SCAR=6.9
97 0 my ( undef, undef, undef, $sub ) = caller(1);
98 0 Carp::confess("attribute $sub is read-only");
99 }
100  
101 32 ▶sub _coderef {
Subroutine _coderef: called CC=3 SCAR=11.7
102 32 ▶ __RO() if @_ > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 32 32
103 32 ▶ $_[0]{'_coderef'} //= $_FIELDS->{'_coderef'}->{'default'}->( $_[0] );
Condition66%2/3
$_[0]{"_coderef"} //= $Sys::Cmd::_FIELDS->{"_coderef"}{"default"}->($_[0])
l!l&&r!l&&!r
0230
MC/DC50%1/2
$_[0]{"_coderef"} //= $Sys::Cmd::_FIELDS->{"_coderef"}{"default"}->($_[0])
$_[0]{"_coderef"} $Sys::Cmd::_FIELDS->{"_coderef"}{"default"}->($_[0])
Truth table66%2/3
A //= B
A= $_[0]{"_coderef"}B= $Sys::Cmd::_FIELDS->{"_coderef"}{"default"}->($_[0])
ABresult
1X1
011
000
104 }
105 98 ▶sub cmd { __RO() if @_ > 1; $_[0]{'cmd'} // undef }
Subroutine cmd: called CC=3 SCAR=12.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 98 98
Condition50%1/2
$_[0]{"cmd"} // undef
l!l
980
MC/DC0%0/1
$_[0]{"cmd"} // undef
$_[0]{"cmd"}
Truth table50%1/2
A
A= $_[0]{"cmd"}
Aresult
11
00
106 32 ▶sub dir { __RO() if @_ > 1; $_[0]{'dir'} // undef }
Subroutine dir: called CC=3 SCAR=11.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 32 32
Condition100%2/2
$_[0]{"dir"} // undef
l!l
824
MC/DC100%1/1
$_[0]{"dir"} // undef
$_[0]{"dir"}
Truth table100%2/2
A
A= $_[0]{"dir"}
Aresult
11
00
107  
108 65 ▶sub encoding {
Subroutine encoding: called CC=5 SCAR=18.4
Pod documented
109 65 ▶ __RO() if @_ > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 65 65
110 65 ▶ $_[0]{'encoding'} //= eval {
Condition66%2/3
$_[0]{"encoding"} //= eval { do { $Sys::Cmd::_FIELDS->{"encoding"}{"isa"}->($Sys::Cmd::_FIELDS->{"encoding"}{"default"}) } }
l!l&&r!l&&!r
33320
MC/DC0%0/2
$_[0]{"encoding"} //= eval { do { $Sys::Cmd::_FIELDS->{"encoding"}{"isa"}->($Sys::Cmd::_FIELDS->{"encoding"}{"default"}) } }
$_[0]{"encoding"} eval { do { $Sys::Cmd::_FIELDS->{"encoding"}{"isa"}->($Sys::Cmd::_FIELDS->{"encoding"}{"default"}) } }
Truth table66%2/3
A //= B
A= $_[0]{"encoding"}B= eval { do { $Sys::Cmd::_FIELDS->{"encoding"}{"isa"}->($Sys::Cmd::_FIELDS->{"encoding"}{"default"}) } }
ABresult
1X1
011
000
111 $_FIELDS->{'encoding'}->{'isa'}
112 32 ->( $_FIELDS->{'encoding'}->{'default'} );
113 };
114 65 ▶ delete $_[0]{'encoding'}
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 65 65
Condition25%1/4
$@ && (delete $_[0]{'encoding'} || Carp::confess('invalid (Sys::Cmd::encoding) default: ' . $@))
!ll
650
delete $_[0]{"encoding"} or Carp::confess('invalid (Sys::Cmd::encoding) default: ' . $@)
l!l
00
MC/DC0%0/2
$@ && (delete $_[0]{'encoding'} || Carp::confess('invalid (Sys::Cmd::encoding) default: ' . $@))
$@ delete $_[0]{"encoding"}
Truth table33%1/3
A && B
A= $@B= delete $_[0]{"encoding"}
ABresult
0X0
100
111
115 || Carp::confess( 'invalid (Sys::Cmd::encoding) default: ' . $@ )
116 if $@;
117 65 $_[0]{'encoding'};
118 }
119 62 ▶sub env { __RO() if @_ > 1; $_[0]{'env'} // undef }
Subroutine env: called CC=3 SCAR=11.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 62 62
Condition100%2/2
$_[0]{"env"} // undef
l!l
4913
MC/DC100%1/1
$_[0]{"env"} // undef
$_[0]{"env"}
Truth table100%2/2
A
A= $_[0]{"env"}
Aresult
11
00
120 7 ▶sub err { __RO() if @_ > 1; $_[0]{'err'} // undef }
Subroutine err: called CC=3 SCAR=11.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 7 7
Condition100%2/2
$_[0]{"err"} // undef
l!l
34
MC/DC100%1/1
$_[0]{"err"} // undef
$_[0]{"err"}
Truth table100%2/2
A
A= $_[0]{"err"}
Aresult
11
00
121 7 ▶sub exit { __RO() if @_ > 1; $_[0]{'exit'} // undef }
Subroutine exit: called CC=3 SCAR=11.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 7 7
Condition100%2/2
$_[0]{"exit"} // undef
l!l
34
MC/DC100%1/1
$_[0]{"exit"} // undef
$_[0]{"exit"}
Truth table100%2/2
A
A= $_[0]{"exit"}
Aresult
11
00
122 31 ▶sub input { __RO() if @_ > 1; $_[0]{'input'} // undef }
Subroutine input: called CC=3 SCAR=11.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 31 31
Condition100%2/2
$_[0]{"input"} // undef
l!l
823
MC/DC100%1/1
$_[0]{"input"} // undef
$_[0]{"input"}
Truth table100%2/2
A
A= $_[0]{"input"}
Aresult
11
00
123 0 ▶sub log_any { __RO() if @_ > 1; $_[0]{'log_any'} // undef }
Subroutine log_any: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 0 0
Condition0%0/2
$_[0]{"log_any"} // undef
l!l
00
MC/DC0%0/1
$_[0]{"log_any"} // undef
$_[0]{"log_any"}
Truth table0%0/2
A
A= $_[0]{"log_any"}
Aresult
11
00
124  
125 0 ▶sub mock {
Subroutine mock: not called CC=5 SCAR=34.0
Pod documented
126 0 ▶ if ( @_ > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ > 1) 0 0 0
127 0 $_[0]{'mock'} = eval { $_FIELDS->{'mock'}->{'isa'}->( $_[1] ) };
128 0 ▶ delete $_[0]{'mock'}
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
Condition0%0/5
$@ && (delete $_[0]{'mock'} || Carp::confess('invalid (Sys::Cmd::mock) value: ' . $@))
!ll&&!rl&&r
000
delete $_[0]{"mock"} or Carp::confess('invalid (Sys::Cmd::mock) value: ' . $@)
l!l
00
MC/DC0%0/2
$@ && (delete $_[0]{'mock'} || Carp::confess('invalid (Sys::Cmd::mock) value: ' . $@))
$@ delete $_[0]{"mock"}
Truth table0%0/3
A && B
A= $@B= delete $_[0]{"mock"}
ABresult
0X0
100
111
129 || Carp::confess( 'invalid (Sys::Cmd::mock) value: ' . $@ )
130 if $@;
131 }
132 0 ▶ $_[0]{'mock'} // undef;
Condition0%0/2
$_[0]{"mock"} // undef
l!l
00
MC/DC0%0/1
$_[0]{"mock"} // undef
$_[0]{"mock"}
Truth table0%0/2
A
A= $_[0]{"mock"}
Aresult
11
00
133 }
134  
135 32 ▶sub on_exit {
Subroutine on_exit: called CC=3 SCAR=11.7
Pod documented
136 0 ▶ if ( @_ > 1 ) { $_[0]{'on_exit'} = $_[1] }
Branch: 1 branch
BranchTrueFalseTotal
if (@_ > 1) 0 32 32
137 32 ▶ $_[0]{'on_exit'} // undef;
Condition100%2/2
$_[0]{"on_exit"} // undef
l!l
230
MC/DC100%1/1
$_[0]{"on_exit"} // undef
$_[0]{"on_exit"}
Truth table100%2/2
A
A= $_[0]{"on_exit"}
Aresult
11
00
138 }
139 7 ▶sub out { __RO() if @_ > 1; $_[0]{'out'} // undef }
Subroutine out: called CC=3 SCAR=11.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 7 7
Condition100%2/2
$_[0]{"out"} // undef
l!l
43
MC/DC100%1/1
$_[0]{"out"} // undef
$_[0]{"out"}
Truth table100%2/2
A
A= $_[0]{"out"}
Aresult
11
00
140 @_CLASS = grep 1, ### END Class::Inline ###
141 {
142 cmd => {
143 35 ▶ isa => sub {
Subroutine __ANON__: called CC=4 SCAR=14.8
144 35 ▶ ref $_[0] eq 'ARRAY' || _croak("cmd must be ARRAYREF");
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq "ARRAY" or _croak("cmd must be ARRAYREF") 35 0 35
145 35 ▶ @{ $_[0] } || _croak("Missing cmd elements");
Branch: 1 branch
BranchTrueFalseTotal
@{$_[0];} or _croak("Missing cmd elements") 35 0 35
146 35 ▶ if ( grep { !defined $_ } @{ $_[0] } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {not defined $_;} @{$_[0];}) 0 35 35
147 0 _croak('cmd array cannot contain undef elements');
148 }
149 35 $_[0];
150 },
151 required => 1,
152 },
153 _coderef => {
154 32 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
155 32 my $c = $_[0]->cmd->[0];
156 32 ▶ ref($c) eq 'CODE' ? $c : undef;
Branch: 1 branch
BranchTrueFalseTotal
ref $c eq 'CODE' ? : 2 30 32
157 },
158 },
159 encoding => {
160 default => $ENCODING_LOCALE,
161 32 ▶ isa => sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
162 32 ▶ resolve_alias( $_[0] )
Branch: 1 branch
BranchTrueFalseTotal
&resolve_alias($_[0]) or _croak("Unknown Encoding: $_[0]") 32 0 32
163 || _croak("Unknown Encoding: $_[0]");
164 32 $_[0];
165 },
166 },
167 env => {
168 19 ▶ isa => sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
169 19 ▶ ref $_[0] eq 'HASH' || _croak("env must be HASHREF");
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq "HASH" or _croak("env must be HASHREF") 19 0 19
170 19 $_[0];
171 },
172 },
173 dir => {
174 11 ▶ isa => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
175 11 ▶ -d $_[0] || _croak("directory not found: $_[0]");
Branch: 1 branch
BranchTrueFalseTotal
-d $_[0] or _croak("directory not found: $_[0]") 9 2 11
176 9 $_[0];
177 },
178 },
179 input => {},
180 log_any => {},
181 out => {},
182 err => {},
183 exit => {},
184 mock => {
185 is => 'rw',
186 0 ▶ isa => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
187 0 ▶ ( ( not defined $_[0] ) || 'CODE' eq ref $_[0] )
Branch: 1 branch
BranchTrueFalseTotal
not defined $_[0] or "CODE" eq ref $_[0] or _croak("must be CODEref") 0 0 0
Condition0%0/3
not defined $_[0] or "CODE" eq ref $_[0]
l!l&&r!l&&!r
000
MC/DC0%0/2
not defined $_[0] or "CODE" eq ref $_[0]
not defined $_[0] "CODE" eq ref $_[0]
Truth table0%0/3
not(A) or B
A= not defined $_[0]B= "CODE" eq ref $_[0]
ABresult
1X1
011
000
188 || _croak('must be CODEref');
189 0 $_[0];
190 },
191 },
192 2 on_exit => { is => 'rw', },
193 };
194  
195 9 ▶sub _croak {
Subroutine _croak: called CC=1 SCAR=0.0
196 9 local $Carp::CarpInternal{'Sys::Cmd'} = 1;
197 9 local $Carp::CarpInternal{'Sys::Cmd::Process'} = 1;
198 9 Carp::croak(@_);
199 }
200  
201 41 ▶sub _syscmd {
Subroutine _syscmd: called CC=14 SCAR=27.2
202 41 my $template = shift;
203  
204 41 my ( @cmd, $opts );
205 41 foreach my $arg (@_) {
206 100 ▶ if ( ref($arg) eq 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $arg eq 'HASH') { } 28 72 100
207 28 ▶ _croak( __PACKAGE__ . ': only a single hashref allowed' )
Branch: 1 branch
BranchTrueFalseTotal
if $opts 0 28 28
208 if $opts;
209 28 $opts = $arg;
210 }
211 else {
212 72 push( @cmd, $arg );
213 }
214 }
215 41 ▶ $opts //= {};
Condition100%2/2
$opts //= {}
l!l
2813
MC/DC100%1/1
$opts //= {}
$opts
Truth table100%2/2
A
A= $opts
Aresult
11
00
216  
217 41 ▶ if ($template) {
Branch: 1 branch
BranchTrueFalseTotal
if ($template) 2 39 41
218 2 $opts->{cmd} = [ @{ $template->cmd }, @cmd ];
219 2 ▶ if ( exists $opts->{env} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $opts->{"env"}) 0 2 2
220 0 my %env = ( each %{ $template->env }, each %{ $opts->{env} } );
221 0 $opts->{env} = \%env;
222 }
223 2 return Sys::Cmd->new( { %$template, %$opts } );
224 }
225  
226 39 ▶ _croak('$cmd must be defined') unless @cmd && defined $cmd[0];
Branch: 1 branch
BranchTrueFalseTotal
unless @cmd and defined $cmd[0] 0 39 39
Condition33%1/3
@cmd and defined $cmd[0]
!ll&&!rl&&r
0039
MC/DC0%0/2
@cmd and defined $cmd[0]
@cmd defined $cmd[0]
Truth table33%1/3
A and B
A= @cmdB= defined $cmd[0]
ABresult
0X0
100
111
227  
228 39 ▶ if ( 'CODE' ne ref( $cmd[0] ) and not $opts->{mock} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("CODE" ne ref $cmd[0] and not $opts->{"mock"}) 37 2 39
Condition66%2/3
"CODE" ne ref $cmd[0] and not $opts->{"mock"}
!ll&&!rl&&r
2037
MC/DC50%1/2
"CODE" ne ref $cmd[0] and not $opts->{"mock"}
"CODE" ne ref $cmd[0] not $opts->{"mock"}
Truth table66%2/3
A and not(B)
A= "CODE" ne ref $cmd[0]B= not $opts->{"mock"}
ABresult
0X0
100
111
229 37 delete $opts->{mock};
230 37 require File::Spec;
231 37 ▶ if ( File::Spec->splitdir( $cmd[0] ) == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("File::Spec"->splitdir($cmd[0]) == 1) 5 32 37
232 5 require File::Which;
233 5 ▶ $cmd[0] = File::Which::which( $cmd[0] )
Condition100%3/3
File::Which::which($cmd[0]) || _croak('command not found: ' . $cmd[0])
l!l&&r!l&&!r
122
MC/DC0%0/2
File::Which::which($cmd[0]) || _croak('command not found: ' . $cmd[0])
File::Which::which($cmd[0]) _croak('command not found: ' . $cmd[0])
Truth table33%1/3
A || B
A= File::Which::which($cmd[0])B= _croak('command not found: ' . $cmd[0])
ABresult
1X1
011
000
234 || _croak( 'command not found: ' . $cmd[0] );
235 }
236  
237 33 ▶ if ( !-x $cmd[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-x $cmd[0]) 2 31 33
238 2 _croak( 'command not executable: ' . $cmd[0] );
239 }
240 }
241 33 $opts->{cmd} = \@cmd;
242 33 Sys::Cmd->new($opts);
243 }
244  
245 30 ▶my sub _fastspawn {
Subroutine _fastspawn: called CC=17 SCAR=30.4
246 30 my @cmd = @_;
247  
248 # Backup the original 0,1,2 file descriptors
249 30 open my $old_fd0, '<&', 0;
250 30 open my $old_fd1, '>&', 1;
251 30 open my $old_fd2, '>&', 2;
252  
253 # Get new handles to descriptors 0,1,2
254 30 my $fd0 = IO::Handle->new_from_fd( 0, 'r' );
255 30 my $fd1 = IO::Handle->new_from_fd( 1, 'w' );
256 30 my $fd2 = IO::Handle->new_from_fd( 2, 'w' );
257  
258 # New handles for the child
259 30 my $stdin = IO::Handle->new;
260 30 my $stdout = IO::Handle->new;
261 30 my $stderr = IO::Handle->new;
262  
263 # Pipe our filehandles to new child filehandles
264 30 ▶ pipe( my $child_in, $stdin ) || die "pipe: $!";
Branch: 1 branch
BranchTrueFalseTotal
pipe my $child_in, $stdin or die "pipe: $!" 30 0 30
265 30 ▶ pipe( $stdout, my $child_out ) || die "pipe: $!";
Branch: 1 branch
BranchTrueFalseTotal
pipe $stdout, my $child_out or die "pipe: $!" 30 0 30
266 30 ▶ pipe( $stderr, my $child_err ) || die "pipe: $!";
Branch: 1 branch
BranchTrueFalseTotal
pipe $stderr, my $child_err or die "pipe: $!" 30 0 30
267  
268 # Make sure that 0,1,2 are inherited (probably are anyway)
269 30 Proc::FastSpawn::fd_inherit( $_, 1 ) for 0, 1, 2;
270  
271 # But don't inherit the rest
272 Proc::FastSpawn::fd_inherit( fileno($_), 0 )
273 30 for $old_fd0, $old_fd1, $old_fd2,
274 $child_in, $child_out, $child_err,
275 $stdin, $stdout, $stderr;
276  
277 # Re-open 0,1,2 by duping the child pipe ends
278 30 ▶ open $fd0, '<&', fileno($child_in) || die "open: $!";
Condition50%1/2
fileno $child_in || die("open: $!")
l!l
300
MC/DC0%0/1
fileno $child_in || die("open: $!")
fileno $child_in
Truth table50%1/2
A
A= fileno $child_in
Aresult
11
00
279 30 ▶ open $fd1, '>&', fileno($child_out) || die "open: $!";
Condition50%1/2
fileno $child_out || die("open: $!")
l!l
300
MC/DC0%0/1
fileno $child_out || die("open: $!")
fileno $child_out
Truth table50%1/2
A
A= fileno $child_out
Aresult
11
00
280 30 ▶ open $fd2, '>&', fileno($child_err) || die "open: $!";
Condition50%1/2
fileno $child_err || die("open: $!")
l!l
300
MC/DC0%0/1
fileno $child_err || die("open: $!")
fileno $child_err
Truth table50%1/2
A
A= fileno $child_err
Aresult
11
00
281  
282 # Kick off the new process
283 30 my $pid = eval {
284 Proc::FastSpawn::spawn(
285 $cmd[0],
286 \@cmd,
287 [
288 30 ▶ map { $_ . '=' . ( defined $ENV{$_} ? $ENV{$_} : '' ) }
Branch: 1 branch
BranchTrueFalseTotal
defined $ENV{$_} ? : 1068 0 1068
289 keys %ENV
290 ]
291 );
292 };
293 30 my $err = $@;
294  
295 # Restore our local 0,1,2 to the originals
296 30 ▶ open $fd0, '<&', fileno($old_fd0) || die "open: $!";
Condition50%1/2
fileno $old_fd0 || die("open: $!")
l!l
300
MC/DC0%0/1
fileno $old_fd0 || die("open: $!")
fileno $old_fd0
Truth table50%1/2
A
A= fileno $old_fd0
Aresult
11
00
297 30 ▶ open $fd1, '>&', fileno($old_fd1) || die "open: $!";
Condition50%1/2
fileno $old_fd1 || die("open: $!")
l!l
300
MC/DC0%0/1
fileno $old_fd1 || die("open: $!")
fileno $old_fd1
Truth table50%1/2
A
A= fileno $old_fd1
Aresult
11
00
298 30 ▶ open $fd2, '>&', fileno($old_fd2) || die "open: $!";
Condition50%1/2
fileno $old_fd2 || die("open: $!")
l!l
300
MC/DC0%0/1
fileno $old_fd2 || die("open: $!")
fileno $old_fd2
Truth table50%1/2
A
A= fileno $old_fd2
Aresult
11
00
299  
300 # Parent doesn't need to see the child or backup descriptors anymore
301 close($_) || die "close: $!"
302 30 ▶ for $old_fd0,
Branch: 1 branch
BranchTrueFalseTotal
close $_ or die "close: $!" 180 0 180
303 $old_fd1,
304 $old_fd2,
305 $child_in,
306 $child_out,
307 $child_err;
308  
309 # Complain if the spawn failed for some reason
310 30 ▶ _croak($err) if $err;
Branch: 1 branch
BranchTrueFalseTotal
if $err 0 30 30
311 30 ▶ _croak('Unable to spawn child') unless defined $pid;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $pid 0 30 30
312  
313 (
314 30 pid => $pid,
315 stdin => $stdin,
316 stdout => $stdout,
317 stderr => $stderr
318 );
319 }
320  
321 2 ▶my sub _fork {
Subroutine _fork: called CC=14 SCAR=28.5
322 2 ▶ my $encoding = shift // die 'need encoding';
Condition50%1/2
shift() // die("need encoding")
l!l
20
MC/DC0%0/1
shift() // die("need encoding")
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
323 2 ▶ my $code = shift // die 'need code';
Condition50%1/2
shift() // die("need code")
l!l
20
MC/DC0%0/1
shift() // die("need code")
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
324 2 my @args = @_;
325 2 my ( $stdin, $stdout, $stderr ) =
326 ( IO::Handle->new, IO::Handle->new, IO::Handle->new, );
327  
328 2 ▶ pipe( my $child_in, $stdin ) || die "pipe: $!";
Branch: 1 branch
BranchTrueFalseTotal
pipe my $child_in, $stdin or die "pipe: $!" 2 0 2
329 2 ▶ pipe( $stdout, my $child_out ) || die "pipe: $!";
Branch: 1 branch
BranchTrueFalseTotal
pipe $stdout, my $child_out or die "pipe: $!" 2 0 2
330 2 ▶ pipe( $stderr, my $child_err ) || die "pipe: $!";
Branch: 1 branch
BranchTrueFalseTotal
pipe $stderr, my $child_err or die "pipe: $!" 2 0 2
331  
332 2 my $pid = fork();
333 2 ▶ if ( !defined $pid ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $pid) 0 2 2
334 0 my $why = $!;
335 0 die "fork: $why";
336 }
337  
338 2 ▶ if ( $pid > 0 ) { # parent
Branch: 1 branch
BranchTrueFalseTotal
if ($pid > 0) 1 1 2
339 1 close($_) for
340 $child_in,
341 $child_out,
342 $child_err;
343  
344 return (
345 1 pid => $pid,
346 stdin => $stdin,
347 stdout => $stdout,
348 stderr => $stderr
349 );
350 }
351  
352 # Child
353 1 $child_err->autoflush(1);
354  
355 1 foreach my $quad (
356 [ \*STDERR, '>&=', fileno($child_err), 1 ],
357 [ \*STDOUT, '>&=', fileno($child_out), 1 ],
358 [ \*STDIN, '<&=', fileno($child_in), 0 ],
359 )
360 {
361 3 my ( $fh, $mode, $fileno, $autoflush ) = @$quad;
362  
363 3 ▶ open( $fh, $mode, $fileno )
Branch: 1 branch
BranchTrueFalseTotal
open $fh, $mode, $fileno or print $child_err sprintf("[%d] open %s, %s: %s\n", $pid, $fh, $mode, $!) 3 0 3
364 or print $child_err sprintf "[%d] open %s, %s: %s\n", $pid,
365 $fh, $mode, $!;
366  
367 3 ▶ binmode $fh, ':encoding(' . $encoding . ')'
Branch: 1 branch
BranchTrueFalseTotal
binmode $fh, ':encoding(' . $encoding . ')' or warn sprintf("[%d] binmode %d(%s) %s: %s", $pid, $fileno, $mode, $encoding, $!) 3 0 3
368 or warn sprintf "[%d] binmode %d(%s) %s: %s", $pid,
369 $fileno, $mode, $encoding, $!;
370  
371 3 ▶ $fh->autoflush(1) if $autoflush;
Branch: 1 branch
BranchTrueFalseTotal
if $autoflush 2 1 3
372 }
373  
374 1 close($_) for
375 $stdin,
376 $stdout,
377 $stderr,
378 $child_in,
379 $child_out,
380 $child_err;
381  
382 1 $code->(@args);
383 0 _exit(0);
384  
385 # exec( @{ $self->cmd } );
386 # die "exec: $!";
387 }
388  
389 32 ▶sub _spawn {
Subroutine _spawn: called CC=18 SCAR=29.1
390 32 my $self = shift;
391 32 my $dir = $self->dir;
392 32 ▶ my $cwd = getcwd if defined $dir;
Branch: 1 branch
BranchTrueFalseTotal
if defined $dir 8 24 32
393  
394 32 my $proc = eval {
395 32 local %ENV = %ENV;
396 32 my $locale = $self->encoding;
397 32 ▶ while ( my ( $key, $val ) = each %{ $self->env // {} } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$self->env // {};}) 30 32 62
Condition100%2/2
$self->env // {}
l!l
4913
MC/DC100%1/1
$self->env // {}
$self->env
Truth table100%2/2
A
A= $self->env
Aresult
11
00
398 30 my $keybytes = encode( $locale, $key, Encode::FB_CROAK );
399 30 ▶ if ( defined $val ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val) { } 24 6 30
400 24 $ENV{$keybytes} = encode( $locale, $val, Encode::FB_CROAK );
401 }
402 else {
403 6 delete $ENV{$keybytes};
404 }
405 }
406  
407 32 ▶ chdir $dir or die "chdir: $!" if defined $dir;
Branch: 1 branch
BranchTrueFalseTotal
if defined $dir 8 24 32
Condition75%3/4
defined $dir && (chdir $dir || die("chdir: $!"))
!ll
248
chdir $dir or die "chdir: $!"
l!l
80
MC/DC0%0/2
defined $dir && (chdir $dir || die("chdir: $!"))
defined $dir chdir $dir
Truth table33%1/3
A && B
A= defined $dirB= chdir $dir
ABresult
0X0
100
111
408 32 my $oe = $self->on_exit;
409  
410 Sys::Cmd::Process->new(
411 cmd => $self->cmd,
412 $oe ? ( on_exit => $oe ) : (),
413 $self->_coderef
414 2 ? _fork( $self->encoding, @{ $self->cmd } )
415 : _fastspawn(
416 map {
417 61 encode(
418 $locale => $_,
419 Encode::FB_CROAK | Encode::LEAVE_SRC
420 )
421 32 ▶ } @{ $self->cmd }
Branch: 2 branches
BranchTrueFalseTotal
$oe ? : 2 30 32
$self->_coderef ? : 2 30 32
422 )
423 );
424 };
425 31 my $err = $@;
426 31 ▶ chdir $cwd if defined $dir;
Branch: 1 branch
BranchTrueFalseTotal
if defined $dir 7 24 31
427 31 ▶ die $err if $err;
Branch: 1 branch
BranchTrueFalseTotal
if $err 0 31 31
428  
429 31 my $enc = ':encoding(' . $self->encoding . ')';
430 31 ▶ binmode( $proc->stdin, $enc ) or warn "binmode stdin: $!";
Branch: 1 branch
BranchTrueFalseTotal
binmode $proc->stdin, $enc or warn "binmode stdin: $!" 31 0 31
431 31 ▶ binmode( $proc->stdout, $enc ) or warn "binmode stdout: $!";
Branch: 1 branch
BranchTrueFalseTotal
binmode $proc->stdout, $enc or warn "binmode stdout: $!" 31 0 31
432 31 ▶ binmode( $proc->stderr, $enc ) or warn "binmode stderr: $!";
Branch: 1 branch
BranchTrueFalseTotal
binmode $proc->stderr, $enc or warn "binmode stderr: $!" 31 0 31
433  
434 31 $proc->stdin->autoflush(1);
435  
436 # some input was provided
437 31 ▶ if ( defined( my $input = $self->input ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $input = $self->input)) 8 23 31
438 local $SIG{PIPE} =
439 0 ▶ sub { warn "Broken pipe when writing to:" . $proc->cmdline };
Subroutine __ANON__: not called CC=1 SCAR=1.2
440  
441 8 ▶ if ( ( 'ARRAY' eq ref $input ) && @$input ) {
Branch: 2 branches
BranchTrueFalseTotal
if ('ARRAY' eq ref $input and @$input) { } 2 6 8
elsif (length $input) { } 4 2 6
Condition66%2/3
"ARRAY" eq ref $input and @$input
!ll&&!rl&&r
602
MC/DC50%1/2
"ARRAY" eq ref $input and @$input
"ARRAY" eq ref $input @$input
Truth table66%2/3
A and B
A= "ARRAY" eq ref $inputB= @$input
ABresult
0X0
100
111
442 2 $proc->stdin->print(@$input);
443 }
444 elsif ( length $input ) {
445 4 $proc->stdin->print($input);
446 }
447  
448 8 $proc->stdin->close;
449 }
450  
451 31 $proc;
452 }
453  
454 7 ▶sub _run {
Subroutine _run: called CC=12 SCAR=24.9
455 7 my $self = shift;
456 7 my $proc = $self->_spawn;
457 7 my $stderr = $proc->stderr;
458 7 my $stdout = $proc->stdout;
459  
460 # Select idea borrowed from System::Command
461 7 require IO::Select;
462 7 my $select = IO::Select->new( $stdout, $stderr );
463 7 my @err;
464 my @out;
465  
466 7 ▶ while ( my @ready = $select->can_read ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@ready) = $select->can_read) 234 7 241
467 234 for my $fh (@ready) {
468 241 ▶ my $dest = $fh == $stdout ? \@out : \@err;
Branch: 1 branch
BranchTrueFalseTotal
$fh == $stdout ? : 231 10 241
469 241 ▶ if ( defined( my $line = <$fh> ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $line = readline $fh)) { } 227 14 241
470 227 push @$dest, $line;
471 }
472 else {
473 14 $select->remove($fh);
474 14 $fh->close;
475 }
476 }
477 }
478  
479 7 $proc->stdin->close;
480 7 my $ok = $proc->wait_child;
481  
482 7 ▶ if ( my $ref = $self->exit ) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $ref = $self->exit) { } 3 4 7
elsif (not $ok) { } 0 4 4
483 3 $$ref = $proc->exit;
484 }
485 elsif ( !$ok ) {
486 0 _croak( join( '', @err ) . $proc->status );
487 }
488  
489 7 ▶ if ( my $ref = $self->err ) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $ref = $self->err) { } 3 4 7
elsif (@err) { } 1 3 4
490 3 $$ref = join '', @err;
491 }
492 elsif (@err) {
493 1 local @Carp::CARP_NOT = (__PACKAGE__);
494 1 Carp::carp @err;
495 }
496  
497 7 ▶ if ( my $ref = $self->out ) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $ref = $self->out) { } 4 3 7
elsif (defined(my $wa = wantarray)) { } 2 1 3
498 4 $$ref = join '', @out;
499 }
500 elsif ( defined( my $wa = wantarray ) ) {
501 2 ▶ return @out if $wa;
Branch: 1 branch
BranchTrueFalseTotal
if $wa 1 1 2
502 1 return join( '', @out );
503 }
504 }
505  
506 # Legacy object interface, undocumented.
507 2 ▶sub run { _syscmd(@_)->_run }
Subroutine run: called CC=1 SCAR=0.0
Pod documented
508 0 ▶sub spawn { _syscmd(@_)->_spawn }
Subroutine spawn: not called CC=1 SCAR=6.9
Pod documented
509  
510 2 1;
511  
512 __END__
↑ Summary blib/lib/Sys/Cmd/Process.pm »