| 1 | package Shell::Command; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | $Shell::Command::AUTHORITY = 'cpan:FLORA'; | |||||||||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||||||||
| 5 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | $Shell::Command::VERSION = '0.06'; | |||||||||||||||||||||||||||
| 7 | } | ||||||||||||||||||||||||||||
| 8 | # ABSTRACT: Cross-platform functions emulating common shell commands | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # This must come first before ExtUtils::Command is loaded to ensure it | ||||||||||||||||||||||||||||
| 11 | # takes effect. | ||||||||||||||||||||||||||||
| 12 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 4 | ▶ | *CORE::GLOBAL::exit = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 14 | 4 | ▶ | CORE::exit($_[0]) unless caller eq 'ExtUtils::Command'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 3 | ▶ | my $exit = $_[0] || 0; | ||||||||||||||||||||||||||
|
Condition100%2/2
$_[0] || 0
MC/DC100%1/1
$_[0] || 0
$_[0]
Truth table100%2/2
A
A= $_[0]
| |||||||||||||||||||||||||||||
| 17 | 3 | die "exit: $exit\n"; | |||||||||||||||||||||||||||
| 18 | 2 | }; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use ExtUtils::Command (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use Exporter; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 2 | @ISA = qw(Exporter); | |||||||||||||||||||||||||||
| 25 | 2 | @EXPORT = @ExtUtils::Command::EXPORT; | |||||||||||||||||||||||||||
| 26 | 2 | @EXPORT_OK = @ExtUtils::Command::EXPORT_OK; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 2 | foreach my $func (@ExtUtils::Command::EXPORT, | |||||||||||||||||||||||||||
| 32 | @ExtUtils::Command::EXPORT_OK) | ||||||||||||||||||||||||||||
| 33 | { | ||||||||||||||||||||||||||||
| 34 | 2 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 35 | 24 | ▶ | *{$func} = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.8
| |||||||||||||||||||||||||||||
| 36 | 5 | local @ARGV = @_; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 5 | my $ret; | |||||||||||||||||||||||||||
| 39 | 5 | eval { | |||||||||||||||||||||||||||
| 40 | 5 | $ret = &{'ExtUtils::Command::'.$func}; | |||||||||||||||||||||||||||
| 41 | }; | ||||||||||||||||||||||||||||
| 42 | 5 | ▶ | if( $@ =~ /^exit: (\d+)\n$/ ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 43 | 3 | $ret = !$1; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | elsif( $@ ) { | ||||||||||||||||||||||||||||
| 46 | 0 | die $@; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | else { | ||||||||||||||||||||||||||||
| 49 | 2 | ▶ | $ret = 1 unless defined $ret and length $ret; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $ret and length $ret
MC/DC0%0/2
defined $ret and length $ret
defined $ret
length $ret
Truth table33%1/3
A and B
A= defined $retB= length $ret
| |||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 5 | return $ret; | |||||||||||||||||||||||||||
| 53 | 24 | }; | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 2 | 1; | |||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||||||||||