blib/lib/No/Worries.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 89.7% 35 / 39 CC 1 SCAR 0.0
CC
1
Cov
94%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/No/Worries/Date.pm ↑ Summary
1 #+##############################################################################
2 # #
3 # File: No/Worries.pm #
4 # #
5 # Description: coding without worries #
6 # #
7 #-##############################################################################
8  
9 #
10 # module definition
11 #
12  
13 package No::Worries;
14 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 21 our $VERSION = "1.7";
17 21 our $REVISION = sprintf("%d.%02d", q$Revision: 1.34 $ =~ /(\d+)\.(\d+)/);
18  
19 #
20 # used modules
21 #
22  
23 21 ▶use Sys::Hostname qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
24 21 ▶use No::Worries::Export qw(export_control);
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 #
27 # global variables
28 #
29  
30 21 our($HostName, $ProgramName, $_IntegerRegexp, $_NumberRegexp);
31  
32 #
33 # module initialization
34 #
35  
36 # we set once for all the host name
37 21 ▶$HostName = Sys::Hostname::hostname() || "<unknown-host-name>";
Condition50%1/2
Sys::Hostname::hostname() || '<unknown-host-name>'
l!l
210
MC/DC0%0/1
Sys::Hostname::hostname() || '<unknown-host-name>'
Sys::Hostname::hostname()
Truth table50%1/2
A
A= Sys::Hostname::hostname()
Aresult
11
00
38 21 $HostName = lc($HostName);
39 21 $HostName =~ s/\..+$//;
40  
41 # we set once for all the program name
42 21 ▶$ProgramName = $0 || "<unknown-program-name>";
Condition50%1/2
$0 || '<unknown-program-name>'
l!l
210
MC/DC0%0/1
$0 || '<unknown-program-name>'
$0
Truth table50%1/2
A
A= $0
Aresult
11
00
43 21 $ProgramName =~ s/^.*\///;
44  
45 # private global variables
46 21 $_IntegerRegexp = qr/^\d+$/;
47 21 $_NumberRegexp = qr/^(\d+\.)?\d+$/;
48  
49 #
50 # export control
51 #
52  
53 76 ▶sub import : method {
Subroutine import: called CC=1 SCAR=0.0
54 76 my($pkg, %exported);
55  
56 76 $pkg = shift(@_);
57 76 grep($exported{$_}++, qw($HostName $ProgramName));
58 76 grep($exported{$_}++, qw($_IntegerRegexp $_NumberRegexp));
59 76 export_control(scalar(caller()), $pkg, \%exported, @_);
60 }
61  
62 21 1;
63  
64 __DATA__
« blib/lib/No/Worries/Date.pm ↑ Summary