| 1 | #!/usr/bin/perl | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | =begin metadata | ||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | Name: echo | ||||||||||||||||||||||||||||||||||||||||||
| 6 | Description: echo arguments | ||||||||||||||||||||||||||||||||||||||||||
| 7 | Author: Randy Yarger, randy.yarger@nextel.com | ||||||||||||||||||||||||||||||||||||||||||
| 8 | License: perl | ||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | =end metadata | ||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | package PerlPowerTools::echo; | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 4 | our $VERSION = '1.3'; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | # run if called directly, indirectly, directly par-packed, undirectly par-packed | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 4 | ▶ | __PACKAGE__->run( @ARGV ) if !caller() || caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ || caller(1) eq 'PAR'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ or caller 1 eq "PAR"
not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/
MC/DC0%0/3
not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ or caller 1 eq "PAR"
not caller()
caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/
caller 1 eq "PAR"
Truth table25%1/4
not(A) or B or C
A= not caller()B= caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/C= caller 1 eq "PAR"
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 4 | ▶ | sub run { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 4 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 4 | my $N = 1; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 4 | ▶ | if (@args && $args[0] eq '-n') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@args and $args[0] eq "-n"
MC/DC100%2/2
@args and $args[0] eq "-n"
@args
$args[0] eq "-n"
Truth table100%3/3
A and B
A= @argsB= $args[0] eq "-n"
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | $N = 0; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | shift @args; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 4 | print join ' ', @args; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 4 | ▶ | print "\n" if $N == 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 4 | exit 0; | |||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 1; | ||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||||||||||||||||