| 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())
MC/DC0%0/1
&main(\@ARGV) || die(errdump())
&main(\@ARGV)
Truth table50%1/2
A
A= &main(\@ARGV)
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 78 | 3 | ▶ | pod2usage(-verbose => 2) if $opt{'man'}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 79 | 3 | ▶ | $opt{'version'} && do {print "$Script version: $VERSION\n"; exit 0}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | # Dump options for debugging | ||||||||||||||||||||
| 82 | # | ||||||||||||||||||||
| 83 | 2 | ▶ | die Dumper(\%opt) if $opt{'dump_opt'}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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 !")
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 !")
| |||||||||||||||||||||
| 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__ | ||||||||||||||||||||