bin/wddump

filter: Statementstmt 100% 42 / 42 Branchbran 70.0% 7 / 10 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 86.9% 60 / 69 CC 7 SCAR 13.8
CC
7
Cov
89%
main
7.3
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« blib/lib/WebDyne/CGI.pm ↑ Summary lib/WebDyne/Request/PSGI/Static.pm »
1 #!/usr/bin/env perl
2 #
3 # This file is part of WebDyne.
4 #
5 # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
6 #
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 #
10 # Full license text is available at:
11 #
12 # <http://dev.perl.org/licenses/>
13 #
14  
15  
16 #
17 # Dump the compiled version of WebDyne HTML scripts, as stored in the cache dir
18 #
19 3 ▶use strict qw(vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 3 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23 # Use the base module
24 #
25 3 ▶use WebDyne::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27  
28 # External modules
29 #
30 3 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 3 ▶use Pod::Usage;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 3 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 3 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 3 ▶use FindBin qw($RealBin $Script);
Subroutine BEGIN: called CC=1 SCAR=0.0
35  
36  
37 # Local customisation
38 #
39 3 local $Data::Dumper::Indent=1;
40 3 local $Data::Dumper::Sortkeys=1;
41  
42  
43 # Version Info, must be all one line for MakeMaker, CPAN.
44 #
45 3 $VERSION='3.029';
46  
47  
48 # Run main
49 #
50 3 ▶exit ${&main(\@ARGV) || die errdump()};
Condition50%1/2
&main(\@ARGV) || die(errdump())
l!l
10
MC/DC0%0/1
&main(\@ARGV) || die(errdump())
&main(\@ARGV)
Truth table50%1/2
A
A= &main(\@ARGV)
Aresult
11
00
51  
52  
53 #============================================================================
54  
55  
56 3 ▶sub main {
Subroutine main: called CC=7 SCAR=19.9
57  
58  
59 # Get argv array ref
60 #
61 3 my $argv_ar=shift();
62  
63  
64 # Get command line options
65 #
66 3 my %opt;
67 3 ▶ GetOptions(
Branch: 1 branch
BranchTrueFalseTotal
&GetOptions(\%opt, my(@opt) = ("help|?", "man", "dump_opt|dump-opt|opt", "version")) or pod2usage(2) 3 0 3
68 \%opt,
69 my @opt=(
70 'help|?',
71 'man',
72 'dump_opt|dump-opt|opt',
73 'version'
74 )
75 ) ||
76 pod2usage(2);
77 3 ▶ pod2usage(-verbose => 99, -sections => 'SYNOPSIS|OPTIONS', -exitval => 1) if $opt{'help'};
Branch: 1 branch
BranchTrueFalseTotal
if $opt{"help"} 0 3 3
78 3 ▶ pod2usage(-verbose => 2) if $opt{'man'};
Branch: 1 branch
BranchTrueFalseTotal
if $opt{"man"} 0 3 3
79 3 ▶ $opt{'version'} && do {print "$Script version: $VERSION\n"; exit 0};
Branch: 1 branch
BranchTrueFalseTotal
$opt{"version"} and do { print "$main::Script version: $main::VERSION\n"; exit 0 } 1 2 3
80  
81 # Dump options for debugging
82 #
83 2 ▶ die Dumper(\%opt) if $opt{'dump_opt'};
Branch: 1 branch
BranchTrueFalseTotal
if $opt{"dump_opt"} 1 1 2
84  
85 # Get srce file
86 #
87 1 ▶ my $srce_pn=$argv_ar->[0] ||
Condition33%1/3
$argv_ar->[0] || pod2usage("$main::Script: no source file specified !")
l!l&&r!l&&!r
100
MC/DC0%0/2
$argv_ar->[0] || pod2usage("$main::Script: no source file specified !")
$argv_ar->[0] pod2usage("$main::Script: no source file specified !")
Truth table33%1/3
A || B
A= $argv_ar->[0]B= pod2usage("$main::Script: no source file specified !")
ABresult
1X1
011
000
88 pod2usage("$Script: no source file specified !");
89  
90  
91 # Retrieve
92 #
93 1 my $data_ar=Storable::retrieve($srce_pn);
94  
95  
96 # Dump
97 #
98 1 print Data::Dumper::Dumper($data_ar);
99  
100  
101 # Done
102 #
103 1 return \undef;
104  
105  
106 }
107  
108 __END__
« blib/lib/WebDyne/CGI.pm ↑ Summary lib/WebDyne/Request/PSGI/Static.pm »