| 1 | package MPMinus::Helper::Util; # $Id: Util.pm 224 2017-04-04 10:27:41Z minus $ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | MPMinus::Helper::Util - MPMinus Helper's utility | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | Version 1.03 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | use MPMinus::Helper::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | MPMinus Helper's utility | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | =head1 FUNCTIONS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | =over 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | =item B<cleanProjectName> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | my $name = cleanProjectName( "foo" ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | Returns clean name of project | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | =item B<cleanServerName> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | my $name = cleanServerName( "localhost:80" ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | Returns clean name of server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | =item B<cleanServerNameF> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | my $name = cleanServerNameF( "localhost" ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | Returns clean name of server as file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | =item B<getApache>, B<getApache2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | my $hash = getApache(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | Returns HTTPD_ROOT, SERVER_CONFIG_FILE, SERVER_VERSION and APACHE_VERSION as hash structure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | (reference). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | =item B<newconfig> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | my $config = newconfig( $c ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | Returns new configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | =item B<to_void> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | my $v = to_void( $value ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | Returns '' (void) if undefined $value else - returns $value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | =back | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | Sergey Lepenkov (Serz Minus) L<http://www.serzik.com> E<lt>minus@serzik.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | =head1 LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | This program is free software: you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | the Free Software Foundation, either version 3 of the License, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | This program is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | GNU General Public License for more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | See C<LICENSE> file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 1 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 1 | $VERSION = 1.03; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 1 | ▶ | use base qw /Exporter/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 1 | our @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | getApache getApache2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | newconfig | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | to_void | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | cleanProjectName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | cleanServerName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | cleanServerNameF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | ▶ | use CTK::Util qw/ :ALL /; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | ▶ | use CTK::ConfGenUtil; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 1 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | sub getApache2 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | # Ïðîöåäóðà ïîëó÷åíèÿ (HTTP_ROOT, SERVER_CONFIG_FILE, SERVER_VERSION, APACHE_VERSION) èñõîäÿ èç äàííûõ çàïóùåííîãî APACHE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 1 | ▶ | my $httpdata; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getApache2: called CC=27 SCAR=61.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | my $httpdpath; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 1 | ▶ | if (isostype("Windows")) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | $httpdpath = execute(q{pv.exe -e 2>NUL}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | if ($httpdpath =~ /^httpd.exe\s+\d+\s+\S+\s+(.+?)\s*$/m) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $httpdpath = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $httpdata = execute(qq{$httpdpath -V}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if ($httpdpath =~ /^(apache.+?)\s+\d+\s+\S+\s+(.+?)\1\s*$/im) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | $httpdpath = catfile($2,'httpd.exe'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $httpdata = execute(qq{$httpdpath -V}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | $httpdpath = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | $httpdata = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | # Fix #198 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 1 | my @err; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 1 | foreach my $httpd (qw/httpd apache apachectl apache2ctl apache2 apache22/) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 6 | my $cmd = qq{$httpd -V}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 6 | ▶ | $httpdata = execute($cmd) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 6 | ▶ | push @err, sprintf("%s: %s", $cmd, $_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 6 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 6 | ▶ | last if $httpdata && $httpdata =~ /HTTPD_ROOT/im; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$httpdata and $httpdata =~ /HTTPD_ROOT/im
MC/DC0%0/2
$httpdata and $httpdata =~ /HTTPD_ROOT/im
$httpdata
$httpdata =~ /HTTPD_ROOT/im
Truth table33%1/3
A and B
A= $httpdataB= $httpdata =~ /HTTPD_ROOT/im
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 1 | ▶ | carp(join "\n", @err) if (!$httpdata) && @err | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $httpdata and @err
MC/DC0%0/2
not $httpdata and @err
not $httpdata
@err
Truth table33%1/3
not(A) and B
A= not $httpdataB= @err
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | my $httpd_root = $httpdata =~ /HTTPD_ROOT\="(.+?)"/m ? $1 : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | my $server_config_file = $httpdata =~ /SERVER_CONFIG_FILE\="(.+?)"/m ? $1 : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | my $sver = $httpdata =~ /version\:\s+[a-z]+\/([0-9.]+)/im ? $1 : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | my $aver = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | if ($sver =~ /([0-9]+)\.([0-9]+)\.([0-9]+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | $aver = $1 + ($2/100) + ($3/10000); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } elsif ($sver =~ /([0-9]+)\.([0-9]+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | $aver = $1 + ($2/100); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | } elsif ($sver =~ /([0-9]+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $aver = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | my $httpdconfig = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | if ($server_config_file && $httpd_root) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$server_config_file and $httpd_root
MC/DC0%0/2
$server_config_file and $httpd_root
$server_config_file
$httpd_root
Truth table0%0/3
A and B
A= $server_config_fileB= $httpd_root
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | $httpdconfig = catfile($httpd_root,$server_config_file); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | my $acc = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | unless ($httpdconfig && -e $httpdconfig) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$httpdconfig and -e $httpdconfig
MC/DC0%0/2
$httpdconfig and -e $httpdconfig
$httpdconfig
-e $httpdconfig
Truth table0%0/3
A and B
A= $httpdconfigB= -e $httpdconfig
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | foreach (split /[\/\\]/, $httpdpath) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | $acc = $acc ? catfile($acc,$_) : $_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $httpdconfig = catfile($acc,$server_config_file); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | if ($httpdconfig && (-e $httpdconfig) && ((-f $httpdconfig) || (-l $httpdconfig))) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$httpdconfig and -e $httpdconfig and -f $httpdconfig || -l $httpdconfig
$httpdconfig and -e $httpdconfig
-f $httpdconfig or -l $httpdconfig
MC/DC0%0/4
$httpdconfig and -e $httpdconfig and -f $httpdconfig || -l $httpdconfig
$httpdconfig
-e $httpdconfig
-f $httpdconfig
-l $httpdconfig
Truth table0%0/5
A and B and C or D
A= $httpdconfigB= -e $httpdconfigC= -f $httpdconfigD= -l $httpdconfig
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | HTTPD_ROOT => $acc || $httpd_root, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$acc || $httpd_root
$httpdconfig || ''
MC/DC0%0/2
$acc || $httpd_root
$acc
$httpd_root
MC/DC0%0/1
$httpdconfig || ''
$httpdconfig
Truth table0%0/3
A || B
A= $accB= $httpd_root
Truth table0%0/2
A
A= $httpdconfig
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | SERVER_CONFIG_FILE => $httpdconfig || '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | SERVER_VERSION => $sver, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | APACHE_VERSION => $aver, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | ▶ | sub getApache { goto &getApache2 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getApache: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | sub newconfig { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | # Çàïðîñ äàííûõ êîíôèãóðàöèè | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | my $c = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
newconfig: not called CC=31 SCAR=69.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | my $cfg = $c->config(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my %newcfg = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | Include => 'conf/*.conf', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | my ($k,$v,$d) = ('','',''); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | my $apache = getApache(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | # Apache HTTPD_ROOT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | $k = "HttpdRoot"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Apache HTTPD_ROOT:', _void(value($cfg,lc($k)) || $apache->{HTTPD_ROOT})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
value($cfg, lc $k) || $apache->{'HTTPD_ROOT'}
MC/DC0%0/2
value($cfg, lc $k) || $apache->{'HTTPD_ROOT'}
value($cfg, lc $k)
$apache->{'HTTPD_ROOT'}
Truth table0%0/3
A || B
A= value($cfg, lc $k)B= $apache->{'HTTPD_ROOT'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | # Apache SERVER_CONFIG_FILE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | $k = "ServerConfigFile"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Apache SERVER_CONFIG_FILE:', _void(value($cfg,lc($k)) || $apache->{SERVER_CONFIG_FILE})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
value($cfg, lc $k) || $apache->{'SERVER_CONFIG_FILE'}
MC/DC0%0/2
value($cfg, lc $k) || $apache->{'SERVER_CONFIG_FILE'}
value($cfg, lc $k)
$apache->{'SERVER_CONFIG_FILE'}
Truth table0%0/3
A || B
A= value($cfg, lc $k)B= $apache->{'SERVER_CONFIG_FILE'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | # Apache configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | my %apacheconfig; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | if ((-e $newcfg{ServerConfigFile}) && -e $newcfg{HttpdRoot}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-e $newcfg{"ServerConfigFile"} and -e $newcfg{"HttpdRoot"}
MC/DC0%0/2
-e $newcfg{"ServerConfigFile"} and -e $newcfg{"HttpdRoot"}
-e $newcfg{"ServerConfigFile"}
-e $newcfg{"HttpdRoot"}
Truth table0%0/3
A and B
A= -e $newcfg{"ServerConfigFile"}B= -e $newcfg{"HttpdRoot"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | my $apacheconf = new Config::General( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | -ConfigFile => $newcfg{ServerConfigFile}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | -ConfigPath => [$newcfg{HttpdRoot}], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | -ApacheCompatible => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | -LowerCaseNames => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | %apacheconfig = $apacheconf->getall; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | # ModperlRoot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | $k = "ModperlRoot"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | my @mpvs = ('none', _void(webdir()), 'custom' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | my $vks = value($apacheconfig{documentroot} || ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$apacheconfig{'documentroot'} || ''
MC/DC0%0/1
$apacheconfig{'documentroot'} || ''
$apacheconfig{'documentroot'}
Truth table0%0/2
A
A= $apacheconfig{'documentroot'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | unshift(@mpvs,$vks) if $vks; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | $v = $c->cli_select('ModperlRoot directory:',\@mpvs,1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | $v = $c->cli_prompt('ModperlRoot directory:',_void(value($cfg,lc($k))),) if ($v && $v eq 'custom'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "custom"
MC/DC0%0/2
$v and $v eq "custom"
$v
$v eq "custom"
Truth table0%0/3
A and B
A= $vB= $v eq "custom"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $newcfg{$k} = ($v && $v eq 'none') ? undef : $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "none"
MC/DC0%0/2
$v and $v eq "none"
$v
$v eq "none"
Truth table0%0/3
A and B
A= $vB= $v eq "none"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | # NameVirtualHost | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $k = "NameVirtualHost"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | my $namevirtualhost = array($apacheconfig{namevirtualhost} || ['*:80']); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$apacheconfig{'namevirtualhost'} || ['*:80']
MC/DC0%0/1
$apacheconfig{'namevirtualhost'} || ['*:80']
$apacheconfig{'namevirtualhost'}
Truth table0%0/2
A
A= $apacheconfig{'namevirtualhost'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | push @$namevirtualhost, 'custom','none'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $v = $c->cli_select('NameVirtualHost:', $namevirtualhost, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | $v = $c->cli_prompt('NameVirtualHost:',_void(value($cfg,lc($k))),) if ($v && $v eq 'custom'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "custom"
MC/DC0%0/2
$v and $v eq "custom"
$v
$v eq "custom"
Truth table0%0/3
A and B
A= $vB= $v eq "custom"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | $newcfg{$k} = ($v && $v eq 'none') ? undef : $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "none"
MC/DC0%0/2
$v and $v eq "none"
$v
$v eq "none"
Truth table0%0/3
A and B
A= $vB= $v eq "none"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | # ServerName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | $k = "ServerName"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | my $servername = array($apacheconfig{servername} || ['localhost']); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$apacheconfig{'servername'} || ['localhost']
MC/DC0%0/1
$apacheconfig{'servername'} || ['localhost']
$apacheconfig{'servername'}
Truth table0%0/2
A
A= $apacheconfig{'servername'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | push @$servername, 'custom','none'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | $v = $c->cli_select('ServerName (host):', $servername, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | $v = $c->cli_prompt('ServerName (host):',_void(value($cfg,lc($k))),) if ($v && $v eq 'custom'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "custom"
MC/DC0%0/2
$v and $v eq "custom"
$v
$v eq "custom"
Truth table0%0/3
A and B
A= $vB= $v eq "custom"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | $newcfg{$k} = ($v && $v eq 'none') ? undef : $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "none"
MC/DC0%0/2
$v and $v eq "none"
$v
$v eq "none"
Truth table0%0/3
A and B
A= $vB= $v eq "none"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | # ErrorMail | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | $k = "ErrorMail"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | my $errormail = array($apacheconfig{serveradmin} || ['root@localhost']); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$apacheconfig{'serveradmin'} || ['root@localhost']
MC/DC0%0/1
$apacheconfig{'serveradmin'} || ['root@localhost']
$apacheconfig{'serveradmin'}
Truth table0%0/2
A
A= $apacheconfig{'serveradmin'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | push @$errormail, 'custom','none'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | $v = $c->cli_select('ErrorMail (ServerAdmin):', $errormail, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | $v = $c->cli_prompt('ErrorMail: (ServerAdmin):',_void(value($cfg,lc($k))),) if ($v && $v eq 'custom'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "custom"
MC/DC0%0/2
$v and $v eq "custom"
$v
$v eq "custom"
Truth table0%0/3
A and B
A= $vB= $v eq "custom"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | $newcfg{$k} = ($v && $v eq 'none') ? undef : $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$v and $v eq "none"
MC/DC0%0/2
$v and $v eq "none"
$v
$v eq "none"
Truth table0%0/3
A and B
A= $vB= $v eq "none"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | # SMTP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $k = "SMTP"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | $newcfg{$k} = $c->cli_prompt('SMTP server:', _void(value($cfg,lc($k)))); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | # MailTo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | $k = "MailTo"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Address MailTO:', _void(value($cfg,lc($k)) || $newcfg{ErrorMail})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
value($cfg, lc $k) || $newcfg{'ErrorMail'}
MC/DC0%0/2
value($cfg, lc $k) || $newcfg{'ErrorMail'}
value($cfg, lc $k)
$newcfg{'ErrorMail'}
Truth table0%0/3
A || B
A= value($cfg, lc $k)B= $newcfg{'ErrorMail'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | # MailCC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | $k = "MailCC"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | $newcfg{$k} = $c->cli_prompt('Address MailCC:', _void(value($cfg,lc($k)))); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | # MailFrom | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | $k = "MailFrom"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Address MailFrom:', _void(value($cfg,lc($k)) || $newcfg{ErrorMail})); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
value($cfg, lc $k) || $newcfg{'ErrorMail'}
MC/DC0%0/2
value($cfg, lc $k) || $newcfg{'ErrorMail'}
value($cfg, lc $k)
$newcfg{'ErrorMail'}
Truth table0%0/3
A || B
A= value($cfg, lc $k)B= $newcfg{'ErrorMail'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | # MailCharset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | $k = "MailCharset"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Mail Charset for translating into UTF8:', _void(value($cfg,lc($k)) || 'Windows-1251')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
value($cfg, lc $k) || 'Windows-1251'
MC/DC0%0/1
value($cfg, lc $k) || 'Windows-1251'
value($cfg, lc $k)
Truth table0%0/2
A
A= value($cfg, lc $k)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | # MailCmd | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | $k = "MailCmd"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Mail program (sendmail):', _void(value($cfg,lc($k)) || '/usr/sbin/sendmail')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
value($cfg, lc $k) || '/usr/sbin/sendmail'
MC/DC0%0/1
value($cfg, lc $k) || '/usr/sbin/sendmail'
value($cfg, lc $k)
Truth table0%0/2
A
A= value($cfg, lc $k)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | # MailFlag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | $k = "MailFlag"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | $newcfg{$k} = $c->cli_prompt('Mail program\'s flag:', _void(value($cfg,lc($k)) || '-t')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
value($cfg, lc $k) || '-t'
MC/DC0%0/1
value($cfg, lc $k) || '-t'
value($cfg, lc $k)
Truth table0%0/2
A
A= value($cfg, lc $k)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | return { %newcfg }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | sub to_void { goto &_void } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_void: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | sub cleanProjectName { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | # Ïðàâêà (÷èñòêà) èìåíè ïðîåêòà | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | my $pn = _void(shift); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleanProjectName: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | $pn =~ s/[^a-z0-9_]/X/ig; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | return $pn; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | sub cleanServerName { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | # Ïðàâêà (÷èñòêà) èìåíè ñåðâåðà (ñàéòà) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | my $sn = _void(shift); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleanServerName: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | $sn =~ s/[^a-z0-9_\-.:]/X/ig; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | return $sn; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | sub cleanServerNameF { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | # Ïðàâêà (÷èñòêà) èìåíè ñåðâåðà (ñàéòà) â ñòàíäàðòå èìåí ôàéëîâ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | ▶ | my $sn = _void(shift); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleanServerNameF: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | $sn =~ s/[^a-z0-9_\-.]//ig; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | return $sn; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | sub _void { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | # Âîçâðàùàåò '' (void) ìåñòî undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | my $v = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_void: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | return '' unless defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | return $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||