| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||||||
| 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)]]
}
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)]]
}
| |||||||||||||||||||||||||||||||||
| 40 | 2 | my ( %seen, @new, @build ); | |||||||||||||||||||||||||||||||
| 41 | 2 | my @possible = ($CLASS); | |||||||||||||||||||||||||||||||
| 42 | 2 | ▶ | while (@possible) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 46 | 2 | ▶ | push @build, $c . '::BUILD' if exists &{ $c . '::BUILD' }; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 47 | 2 | $seen{$c}++; | |||||||||||||||||||||||||||||||
| 48 | 2 | ▶ | if ( exists &{ $c . '::DOES' } ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 70 | 2 | ▶ | $_FIELDS = $_FIELDS->{'FIELDS'} if exists $_FIELDS->{'FIELDS'}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 71 | }; | ||||||||||||||||||||||||||||||||
| 72 | 35 | ▶ | if ( my @missing = grep { not exists $_[0]->{$_} } 'cmd' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
Condition25%1/4
$@ && (delete $_[0]{'cmd'} || Carp::confess('Sys::Cmd cmd: ' . $@))
delete $_[0]{"cmd"} or Carp::confess('Sys::Cmd cmd: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 78 | 11 | $_[0]{'dir'} = eval { $_FIELDS->{'dir'}->{'isa'}->( $_[0]{'dir'} ) } | |||||||||||||||||||||||||||||||
| 79 | 35 | ▶ | if exists $_[0]{'dir'}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 80 | 35 | ▶ | delete $_[0]{'dir'} || Carp::confess( 'Sys::Cmd dir: ' . $@ ) if $@; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition75%3/4
$@ && (delete $_[0]{'dir'} || Carp::confess('Sys::Cmd dir: ' . $@))
delete $_[0]{"dir"} or Carp::confess('Sys::Cmd dir: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 81 | $_[0]{'encoding'} = | ||||||||||||||||||||||||||||||||
| 82 | 0 | eval { $_FIELDS->{'encoding'}->{'isa'}->( $_[0]{'encoding'} ) } | |||||||||||||||||||||||||||||||
| 83 | 33 | ▶ | if exists $_[0]{'encoding'}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 84 | 33 | ▶ | delete $_[0]{'encoding'} || Carp::confess( 'Sys::Cmd encoding: ' . $@ ) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$@ && (delete $_[0]{'encoding'} || Carp::confess('Sys::Cmd encoding: ' . $@))
delete $_[0]{"encoding"} or Carp::confess('Sys::Cmd encoding: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 85 | if $@; | ||||||||||||||||||||||||||||||||
| 86 | 19 | $_[0]{'env'} = eval { $_FIELDS->{'env'}->{'isa'}->( $_[0]{'env'} ) } | |||||||||||||||||||||||||||||||
| 87 | 33 | ▶ | if exists $_[0]{'env'}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 88 | 33 | ▶ | delete $_[0]{'env'} || Carp::confess( 'Sys::Cmd env: ' . $@ ) if $@; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$@ && (delete $_[0]{'env'} || Carp::confess('Sys::Cmd env: ' . $@))
delete $_[0]{"env"} or Carp::confess('Sys::Cmd env: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 89 | 0 | $_[0]{'mock'} = eval { $_FIELDS->{'mock'}->{'isa'}->( $_[0]{'mock'} ) } | |||||||||||||||||||||||||||||||
| 90 | 33 | ▶ | if exists $_[0]{'mock'}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 91 | 33 | ▶ | delete $_[0]{'mock'} || Carp::confess( 'Sys::Cmd mock: ' . $@ ) if $@; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$@ && (delete $_[0]{'mock'} || Carp::confess('Sys::Cmd mock: ' . $@))
delete $_[0]{"mock"} or Carp::confess('Sys::Cmd mock: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 103 | 32 | ▶ | $_[0]{'_coderef'} //= $_FIELDS->{'_coderef'}->{'default'}->( $_[0] ); | ||||||||||||||||||||||||||||||
|
Condition66%2/3
$_[0]{"_coderef"} //= $Sys::Cmd::_FIELDS->{"_coderef"}{"default"}->($_[0])
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])
| |||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||
| 105 | 98 | ▶ | sub cmd { __RO() if @_ > 1; $_[0]{'cmd'} // undef } | ||||||||||||||||||||||||||||||
|
Subroutine
cmd: called CC=3 SCAR=12.0
Pod
undocumented
Branch: 1 branch
Condition50%1/2
$_[0]{"cmd"} // undef
MC/DC0%0/1
$_[0]{"cmd"} // undef
$_[0]{"cmd"}
Truth table50%1/2
A
A= $_[0]{"cmd"}
| |||||||||||||||||||||||||||||||||
| 106 | 32 | ▶ | sub dir { __RO() if @_ > 1; $_[0]{'dir'} // undef } | ||||||||||||||||||||||||||||||
|
Subroutine
dir: called CC=3 SCAR=11.1
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"dir"} // undef
MC/DC100%1/1
$_[0]{"dir"} // undef
$_[0]{"dir"}
Truth table100%2/2
A
A= $_[0]{"dir"}
| |||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||
| 108 | 65 | ▶ | sub encoding { | ||||||||||||||||||||||||||||||
|
Subroutine
encoding: called CC=5 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||||||
| 109 | 65 | ▶ | __RO() if @_ > 1; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 110 | 65 | ▶ | $_[0]{'encoding'} //= eval { | ||||||||||||||||||||||||||||||
|
Condition66%2/3
$_[0]{"encoding"} //= eval {
do {
$Sys::Cmd::_FIELDS->{"encoding"}{"isa"}->($Sys::Cmd::_FIELDS->{"encoding"}{"default"})
}
}
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"})
}
}
| |||||||||||||||||||||||||||||||||
| 111 | $_FIELDS->{'encoding'}->{'isa'} | ||||||||||||||||||||||||||||||||
| 112 | 32 | ->( $_FIELDS->{'encoding'}->{'default'} ); | |||||||||||||||||||||||||||||||
| 113 | }; | ||||||||||||||||||||||||||||||||
| 114 | 65 | ▶ | delete $_[0]{'encoding'} | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$@ && (delete $_[0]{'encoding'} || Carp::confess('invalid (Sys::Cmd::encoding) default: ' . $@))
delete $_[0]{"encoding"} or Carp::confess('invalid (Sys::Cmd::encoding) default: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 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
Condition100%2/2
$_[0]{"env"} // undef
MC/DC100%1/1
$_[0]{"env"} // undef
$_[0]{"env"}
Truth table100%2/2
A
A= $_[0]{"env"}
| |||||||||||||||||||||||||||||||||
| 120 | 7 | ▶ | sub err { __RO() if @_ > 1; $_[0]{'err'} // undef } | ||||||||||||||||||||||||||||||
|
Subroutine
err: called CC=3 SCAR=11.1
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"err"} // undef
MC/DC100%1/1
$_[0]{"err"} // undef
$_[0]{"err"}
Truth table100%2/2
A
A= $_[0]{"err"}
| |||||||||||||||||||||||||||||||||
| 121 | 7 | ▶ | sub exit { __RO() if @_ > 1; $_[0]{'exit'} // undef } | ||||||||||||||||||||||||||||||
|
Subroutine
exit: called CC=3 SCAR=11.1
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"exit"} // undef
MC/DC100%1/1
$_[0]{"exit"} // undef
$_[0]{"exit"}
Truth table100%2/2
A
A= $_[0]{"exit"}
| |||||||||||||||||||||||||||||||||
| 122 | 31 | ▶ | sub input { __RO() if @_ > 1; $_[0]{'input'} // undef } | ||||||||||||||||||||||||||||||
|
Subroutine
input: called CC=3 SCAR=11.1
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"input"} // undef
MC/DC100%1/1
$_[0]{"input"} // undef
$_[0]{"input"}
Truth table100%2/2
A
A= $_[0]{"input"}
| |||||||||||||||||||||||||||||||||
| 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
Condition0%0/2
$_[0]{"log_any"} // undef
MC/DC0%0/1
$_[0]{"log_any"} // undef
$_[0]{"log_any"}
Truth table0%0/2
A
A= $_[0]{"log_any"}
| |||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | sub mock { | ||||||||||||||||||||||||||||||
|
Subroutine
mock: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | if ( @_ > 1 ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 127 | 0 | $_[0]{'mock'} = eval { $_FIELDS->{'mock'}->{'isa'}->( $_[1] ) }; | |||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | delete $_[0]{'mock'} | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
$@ && (delete $_[0]{'mock'} || Carp::confess('invalid (Sys::Cmd::mock) value: ' . $@))
delete $_[0]{"mock"} or Carp::confess('invalid (Sys::Cmd::mock) value: ' . $@)
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"}
| |||||||||||||||||||||||||||||||||
| 129 | || Carp::confess( 'invalid (Sys::Cmd::mock) value: ' . $@ ) | ||||||||||||||||||||||||||||||||
| 130 | if $@; | ||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | $_[0]{'mock'} // undef; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[0]{"mock"} // undef
MC/DC0%0/1
$_[0]{"mock"} // undef
$_[0]{"mock"}
Truth table0%0/2
A
A= $_[0]{"mock"}
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 137 | 32 | ▶ | $_[0]{'on_exit'} // undef; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$_[0]{"on_exit"} // undef
MC/DC100%1/1
$_[0]{"on_exit"} // undef
$_[0]{"on_exit"}
Truth table100%2/2
A
A= $_[0]{"on_exit"}
| |||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||
| 139 | 7 | ▶ | sub out { __RO() if @_ > 1; $_[0]{'out'} // undef } | ||||||||||||||||||||||||||||||
|
Subroutine
out: called CC=3 SCAR=11.1
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"out"} // undef
MC/DC100%1/1
$_[0]{"out"} // undef
$_[0]{"out"}
Truth table100%2/2
A
A= $_[0]{"out"}
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 145 | 35 | ▶ | @{ $_[0] } || _croak("Missing cmd elements"); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 146 | 35 | ▶ | if ( grep { !defined $_ } @{ $_[0] } ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
Condition0%0/3
not defined $_[0] or "CODE" eq ref $_[0]
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]
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 207 | 28 | ▶ | _croak( __PACKAGE__ . ': only a single hashref allowed' ) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 208 | if $opts; | ||||||||||||||||||||||||||||||||
| 209 | 28 | $opts = $arg; | |||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||
| 211 | else { | ||||||||||||||||||||||||||||||||
| 212 | 72 | push( @cmd, $arg ); | |||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||
| 215 | 41 | ▶ | $opts //= {}; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$opts //= {}
MC/DC100%1/1
$opts //= {}
$opts
Truth table100%2/2
A
A= $opts
| |||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||
| 217 | 41 | ▶ | if ($template) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 218 | 2 | $opts->{cmd} = [ @{ $template->cmd }, @cmd ]; | |||||||||||||||||||||||||||||||
| 219 | 2 | ▶ | if ( exists $opts->{env} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
Condition33%1/3
@cmd and defined $cmd[0]
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]
| |||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||
| 228 | 39 | ▶ | if ( 'CODE' ne ref( $cmd[0] ) and not $opts->{mock} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
"CODE" ne ref $cmd[0] and not $opts->{"mock"}
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"}
| |||||||||||||||||||||||||||||||||
| 229 | 37 | delete $opts->{mock}; | |||||||||||||||||||||||||||||||
| 230 | 37 | require File::Spec; | |||||||||||||||||||||||||||||||
| 231 | 37 | ▶ | if ( File::Spec->splitdir( $cmd[0] ) == 1 ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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])
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])
| |||||||||||||||||||||||||||||||||
| 234 | || _croak( 'command not found: ' . $cmd[0] ); | ||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||
| 237 | 33 | ▶ | if ( !-x $cmd[0] ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 265 | 30 | ▶ | pipe( $stdout, my $child_out ) || die "pipe: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 266 | 30 | ▶ | pipe( $stderr, my $child_err ) || die "pipe: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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: $!")
MC/DC0%0/1
fileno $child_in || die("open: $!")
fileno $child_in
Truth table50%1/2
A
A= fileno $child_in
| |||||||||||||||||||||||||||||||||
| 279 | 30 | ▶ | open $fd1, '>&', fileno($child_out) || die "open: $!"; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
fileno $child_out || die("open: $!")
MC/DC0%0/1
fileno $child_out || die("open: $!")
fileno $child_out
Truth table50%1/2
A
A= fileno $child_out
| |||||||||||||||||||||||||||||||||
| 280 | 30 | ▶ | open $fd2, '>&', fileno($child_err) || die "open: $!"; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
fileno $child_err || die("open: $!")
MC/DC0%0/1
fileno $child_err || die("open: $!")
fileno $child_err
Truth table50%1/2
A
A= fileno $child_err
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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: $!")
MC/DC0%0/1
fileno $old_fd0 || die("open: $!")
fileno $old_fd0
Truth table50%1/2
A
A= fileno $old_fd0
| |||||||||||||||||||||||||||||||||
| 297 | 30 | ▶ | open $fd1, '>&', fileno($old_fd1) || die "open: $!"; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
fileno $old_fd1 || die("open: $!")
MC/DC0%0/1
fileno $old_fd1 || die("open: $!")
fileno $old_fd1
Truth table50%1/2
A
A= fileno $old_fd1
| |||||||||||||||||||||||||||||||||
| 298 | 30 | ▶ | open $fd2, '>&', fileno($old_fd2) || die "open: $!"; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
fileno $old_fd2 || die("open: $!")
MC/DC0%0/1
fileno $old_fd2 || die("open: $!")
fileno $old_fd2
Truth table50%1/2
A
A= fileno $old_fd2
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 311 | 30 | ▶ | _croak('Unable to spawn child') unless defined $pid; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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")
MC/DC0%0/1
shift() // die("need encoding")
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||||||
| 323 | 2 | ▶ | my $code = shift // die 'need code'; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
shift() // die("need code")
MC/DC0%0/1
shift() // die("need code")
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 329 | 2 | ▶ | pipe( $stdout, my $child_out ) || die "pipe: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 330 | 2 | ▶ | pipe( $stderr, my $child_err ) || die "pipe: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||
| 332 | 2 | my $pid = fork(); | |||||||||||||||||||||||||||||||
| 333 | 2 | ▶ | if ( !defined $pid ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 334 | 0 | my $why = $!; | |||||||||||||||||||||||||||||||
| 335 | 0 | die "fork: $why"; | |||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||
| 338 | 2 | ▶ | if ( $pid > 0 ) { # parent | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
Condition100%2/2
$self->env // {}
MC/DC100%1/1
$self->env // {}
$self->env
Truth table100%2/2
A
A= $self->env
| |||||||||||||||||||||||||||||||||
| 398 | 30 | my $keybytes = encode( $locale, $key, Encode::FB_CROAK ); | |||||||||||||||||||||||||||||||
| 399 | 30 | ▶ | if ( defined $val ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
Condition75%3/4
defined $dir && (chdir $dir || die("chdir: $!"))
chdir $dir or die "chdir: $!"
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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 422 | ) | ||||||||||||||||||||||||||||||||
| 423 | ); | ||||||||||||||||||||||||||||||||
| 424 | }; | ||||||||||||||||||||||||||||||||
| 425 | 31 | my $err = $@; | |||||||||||||||||||||||||||||||
| 426 | 31 | ▶ | chdir $cwd if defined $dir; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 427 | 31 | ▶ | die $err if $err; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||||||
| 429 | 31 | my $enc = ':encoding(' . $self->encoding . ')'; | |||||||||||||||||||||||||||||||
| 430 | 31 | ▶ | binmode( $proc->stdin, $enc ) or warn "binmode stdin: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 431 | 31 | ▶ | binmode( $proc->stdout, $enc ) or warn "binmode stdout: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 432 | 31 | ▶ | binmode( $proc->stderr, $enc ) or warn "binmode stderr: $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||
| 434 | 31 | $proc->stdin->autoflush(1); | |||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||
| 436 | # some input was provided | ||||||||||||||||||||||||||||||||
| 437 | 31 | ▶ | if ( defined( my $input = $self->input ) ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
Condition66%2/3
"ARRAY" eq ref $input and @$input
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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 467 | 234 | for my $fh (@ready) { | |||||||||||||||||||||||||||||||
| 468 | 241 | ▶ | my $dest = $fh == $stdout ? \@out : \@err; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 469 | 241 | ▶ | if ( defined( my $line = <$fh> ) ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 498 | 4 | $$ref = join '', @out; | |||||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||||||
| 500 | elsif ( defined( my $wa = wantarray ) ) { | ||||||||||||||||||||||||||||||||
| 501 | 2 | ▶ | return @out if $wa; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||||||