| 1 | package Panda::Config::Perl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 8 | ▶ | use 5.012; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 8 | ▶ | use Data::Recursive(); # XS code needs xs::merge | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 8 | our $VERSION = '1.1.8'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 8 | XS::Loader::load(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 8 | ▶ | sub process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 8 | my ($class, $file, $initial_cfg) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 8 | my ($mstash, $nsstash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 8 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 8 | $mstash = \%{"::"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 8 | delete $mstash->{'NS::'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 8 | $nsstash = \%{"NS::"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 8 | ▶ | _apply_initial_cfg('', Data::Recursive::clone($initial_cfg)) if $initial_cfg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 8 | _process_file($file); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 6 | my $ret = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 6 | my $cfg = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 6 | ▶ | if(defined $nsstash->{'__CONFIG__'}){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $cfg = ${$nsstash->{'__CONFIG__'}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | delete $nsstash->{'__CONFIG__'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 6 | _get_config($ret, $nsstash, $cfg, ''); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | # remove garbage we've created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 5 | delete $mstash->{'NS::'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 5 | return $ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 4 | ▶ | sub _apply_initial_cfg { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_apply_initial_cfg: called CC=3 SCAR=11.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 4 | my ($ns, $cfg) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 4 | foreach my $key (keys %$cfg) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 8 | ▶ | if (substr($key, -2, 2) eq '::') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | _apply_initial_cfg($ns.$key, $cfg->{$key}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 8 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 8 | *{"NS::$ns$key"} = \$cfg->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 14 | ▶ | sub _process_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process_file: called CC=8 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 14 | my ($file, $ns) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 14 | ▶ | open my $fh, '<', $file or die "Panda::Config::Perl: cannot open $file: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 13 | my $content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 13 | local $/ = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 13 | $content = <$fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 13 | close $fh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 13 | my $curdir = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 13 | ▶ | if ((my $pos = rindex($file, '/')) >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 13 | $curdir = substr($file, 0, $pos); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 13 | $content =~ s/^[^\S\r\n]*#(namespace|namespace-abs|include)(?:[^\S\r\n]+(.+))?$/_process_directive($curdir, $ns, $1, $2)/gme; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 13 | ▶ | my $pkg = $ns ? "NS::$ns" : "NS"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 13 | $content = "package $pkg; sub { $content;\n }"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 13 | my $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 8 | ▶ | no strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 13 | enable_op_tracking(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 13 | my $sub = eval $content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 13 | disable_op_tracking(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 13 | ▶ | $ok = eval { $sub->(); 1 } if $sub; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 13 | ▶ | unless ($ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | my $err = $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 1 | ▶ | die $err if $err =~ /Error-prone code/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1 | ▶ | $err =~ s/Panda::Config::Perl: //g unless ref $err; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | die "Panda::Config::Perl: error while processing config $file: $err\n". | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | "================ Error-prone code ================\n". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | _content_linno($content). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | "=================================================="; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 24 | ▶ | sub _process_directive { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process_directive: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 24 | my ($curdir, $ns, $directive, $rest) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 24 | $rest =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 24 | ▶ | $rest //= ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$rest //= ""
MC/DC100%1/1
$rest //= ""
$rest
Truth table100%2/2
A
A= $rest
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 24 | ▶ | if (index($directive, 'namespace') == 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 19 | ▶ | $ns = '' if $directive eq 'namespace-abs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 19 | ▶ | my $pkg = $ns ? "NS::$ns" : 'NS'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 19 | ▶ | $pkg .= "::$1" if $rest =~ /\s*(\S+)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 19 | return "package $pkg;"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | elsif ($directive eq 'include') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 5 | return "Panda::Config::Perl::_INCLUDE('$curdir', __PACKAGE__, $rest);"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 5 | ▶ | sub _INCLUDE { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_INCLUDE: called CC=6 SCAR=18.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 5 | my ($dir, $curpkg, $file) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 5 | my $ns = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 5 | ▶ | if ($curpkg ne 'NS') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 5 | $ns = $curpkg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 5 | substr($ns, 0, 4, ''); # remove /^NS::/ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 5 | ▶ | unless (substr($file, 0, 1) eq '/') { $file = $dir ? "$dir/$file" : $file } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 5 | ▶ | if (index($file, '*') >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 8 | ▶ | _process_file($_, $ns) for glob($file); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 4 | _process_file($file, $ns); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 23 | ▶ | sub _get_config { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_config: called CC=15 SCAR=29.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 23 | my ($dest, $stash, $config, $ns) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 23 | my @ns_list; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | my $assign_proc; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 23 | ▶ | $assign_proc = $config->{assign_proc} if defined $config->{assign_proc}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 23 | foreach my $key (keys %$stash) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 91 | ▶ | next if $key eq 'BEGIN' or $key eq 'DESTROY' or $key eq 'AUTOLOAD' or index($key, '__ANON__') == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
$key eq "BEGIN" or $key eq "DESTROY" or $key eq "AUTOLOAD" or index($key, "__ANON__") == 0
$key eq "BEGIN" or $key eq "DESTROY" or $key eq "AUTOLOAD"
$key eq "BEGIN" or $key eq "DESTROY"
MC/DC25%1/4
$key eq "BEGIN" or $key eq "DESTROY" or $key eq "AUTOLOAD" or index($key, "__ANON__") == 0
$key eq "BEGIN"
$key eq "DESTROY"
$key eq "AUTOLOAD"
index($key, "__ANON__") == 0
Truth table40%2/5
A or B or C or D
A= $key eq "BEGIN"B= $key eq "DESTROY"C= $key eq "AUTOLOAD"D= index($key, "__ANON__") == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 83 | ▶ | if (substr($key, -2, 2) eq '::') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 18 | push @ns_list, $key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 18 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 65 | ▶ | my $glob = $stash->{$key} or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 65 | ▶ | next if !defined $$glob and defined *$glob{CODE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $$glob and defined *$glob{"CODE"}
MC/DC0%0/2
not defined $$glob and defined *$glob{"CODE"}
not defined $$glob
defined *$glob{"CODE"}
Truth table66%2/3
not(A) and B
A= not defined $$globB= defined *$glob{"CODE"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 65 | ▶ | if(defined $assign_proc){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | $dest->{$key} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $assign_proc->($dest->{$key}, $$glob); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 65 | $dest->{$key} = $$glob; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 23 | foreach my $subns (@ns_list) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 18 | my $substash = \%{$stash->{$subns}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 18 | substr($subns, -2, 2, ''); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 18 | ▶ | my $subns_full = $ns ? "${ns}::$subns" : $subns; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 18 | ▶ | if (exists $dest->{$subns}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 1 | die "Panda::Config::Perl: conflict between variable '$subns' in namespace '$ns' and a namespace '$subns_full'. ". | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | "You shouldn't have variables that overlap with namespaces as they would merge into the same hash.\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 17 | _get_config($dest->{$subns} = {}, $substash, $config, $subns_full); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 1 | ▶ | sub _content_linno { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_content_linno: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | my $content = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 1 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 1 | $content =~ s/^(.*)$/$i++; "$i: $1"/mge; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 1 | return $content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 8 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||