blib/lib/WebDyne/Err/Constant.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 90.0% 27 / 30 CC 2 SCAR 2.9
CC
2
Cov
96%
class_dn
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« bin/wdapacheinit ↑ Summary blib/lib/WebDyne/PAGI.pm »
1 #
2 # This file is part of WebDyne.
3 #
4 # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 # Full license text is available at:
10 #
11 # <http://dev.perl.org/licenses/>
12 #
13 package WebDyne::Err::Constant;
14  
15  
16 # Pragma
17 #
18 41 ▶use strict qw(vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
19 41 ▶use vars qw($VERSION @ISA %Constant);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 41 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23 # Does the heavy liftying of importing into caller namespace
24 #
25 41 require WebDyne::Constant;
26 41 @ISA=qw(WebDyne::Constant);
27  
28  
29 # Need the File::Spec module
30 #
31 41 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33  
34 # Version information
35 #
36 41 $VERSION='3.029';
37  
38  
39 # Hash of constants
40 #
41 41 %Constant=(
42  
43  
44 # Where we keep the error template
45 #
46 WEBDYNE_ERR_TEMPLATE => File::Spec->catfile(&class_dn(__PACKAGE__), 'error.psp'),
47  
48  
49 # If set to 1, error messages will be sent as text/plain, not
50 # HTML. If ERROR_EXIT set, child will quit after an error
51 #
52 WEBDYNE_ERROR_TEXT => 0,
53 WEBDYNE_ERROR_EXIT => 0,
54  
55  
56 );
57  
58  
59 41 ▶sub class_dn {
Subroutine class_dn: called CC=2 SCAR=7.0
Pod undocumented
60  
61  
62 # Get class dir
63 #
64 41 my $class=shift();
65  
66  
67 # Get package file name so we can look up in inc
68 #
69 41 (my $class_fn="${class}.pm")=~s{::}{/}g;
70 41 ▶ $class_fn=$INC{$class_fn} ||
Condition50%1/2
$INC{$class_fn} || die("unable to find location for $class in %INC")
l!l
410
MC/DC0%0/1
$INC{$class_fn} || die("unable to find location for $class in %INC")
$INC{$class_fn}
Truth table50%1/2
A
A= $INC{$class_fn}
Aresult
11
00
71 die("unable to find location for $class in \%INC");
72  
73  
74 # Split
75 #
76 41 my $class_dn=(File::Spec->splitpath($class_fn))[1];
77  
78 }
79  
80  
81 # Done
82 #
83 41 1;
84 __END__
« bin/wdapacheinit ↑ Summary blib/lib/WebDyne/PAGI.pm »