| 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 | |||||||||||||
| 14 | |||||||||||||
| 15 | package WebDyne::Static; | ||||||||||||
| 16 | |||||||||||||
| 17 | |||||||||||||
| 18 | # Compiler Pragma | ||||||||||||
| 19 | # | ||||||||||||
| 20 | 2 | ▶ | use strict qw(vars); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | 2 | ▶ | use vars qw($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 23 | 2 | ▶ | no warnings qw(uninitialized); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 24 | |||||||||||||
| 25 | |||||||||||||
| 26 | # Utilities, constants | ||||||||||||
| 27 | # | ||||||||||||
| 28 | 2 | ▶ | use WebDyne::Constant; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 29 | 2 | ▶ | use WebDyne::Util; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 30 | |||||||||||||
| 31 | |||||||||||||
| 32 | # Version information in a format | ||||||||||||
| 33 | # | ||||||||||||
| 34 | 2 | $VERSION='3.029'; | |||||||||||
| 35 | |||||||||||||
| 36 | |||||||||||||
| 37 | # Debug | ||||||||||||
| 38 | # | ||||||||||||
| 39 | 2 | 0 && debug("%s loaded, version $VERSION"); | |||||||||||
| 40 | |||||||||||||
| 41 | |||||||||||||
| 42 | # And done | ||||||||||||
| 43 | # | ||||||||||||
| 44 | 2 | 1; | |||||||||||
| 45 | |||||||||||||
| 46 | #------------------------------------------------------------------------------ | ||||||||||||
| 47 | |||||||||||||
| 48 | |||||||||||||
| 49 | 2 | ▶ | sub import { | ||||||||||
|
Subroutine
import: called CC=4 SCAR=14.9
| |||||||||||||
| 50 | |||||||||||||
| 51 | |||||||||||||
| 52 | # Will only work if called from within a __PERL__ block in WebDyne | ||||||||||||
| 53 | # | ||||||||||||
| 54 | 2 | ▶ | my $self_cr=UNIVERSAL::can(scalar caller, 'self') || return; | ||||||||||
|
Condition50%1/2
UNIVERSAL::can(scalar caller, 'self') || (return)
MC/DC0%0/1
UNIVERSAL::can(scalar caller, 'self') || (return)
UNIVERSAL::can(scalar caller, 'self')
Truth table50%1/2
A
A= UNIVERSAL::can(scalar caller, 'self')
| |||||||||||||
| 55 | 2 | ▶ | my $self=$self_cr->() || return; | ||||||||||
|
Condition50%1/2
&$self_cr() || (return)
MC/DC0%0/1
&$self_cr() || (return)
&$self_cr()
Truth table50%1/2
A
A= &$self_cr()
| |||||||||||||
| 56 | 2 | ▶ | my $meta_hr=$self->meta() || return err(); | ||||||||||
|
Condition50%1/2
$self->meta || (return err())
MC/DC0%0/1
$self->meta || (return err())
$self->meta
Truth table50%1/2
A
A= $self->meta
| |||||||||||||
| 57 | 2 | $meta_hr->{'static'}=1; | |||||||||||
| 58 | |||||||||||||
| 59 | } | ||||||||||||
| 60 | |||||||||||||
| 61 | |||||||||||||
| 62 | 0 | ▶ | sub handler : method { | ||||||||||
|
Subroutine
handler: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 63 | |||||||||||||
| 64 | |||||||||||||
| 65 | # Handler is a no-op, all work is done by filter code. Need a handler so | ||||||||||||
| 66 | # module is seen by WebDyne autoload method when tracking back through | ||||||||||||
| 67 | # chained modules | ||||||||||||
| 68 | # | ||||||||||||
| 69 | 0 | my $self=shift(); | |||||||||||
| 70 | 0 | $self->static(1); | |||||||||||
| 71 | 0 | $self->SUPER::handler(@_); | |||||||||||
| 72 | |||||||||||||
| 73 | } | ||||||||||||
| 74 | __END__ | ||||||||||||