| 1 | # -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- | ||||||||||
| 2 | # vim:ts=8:sw=2:et:sta:sts=2 | ||||||||||
| 3 | ######### | ||||||||||
| 4 | # Author: rmp | ||||||||||
| 5 | # | ||||||||||
| 6 | package ClearPress::authenticator; | ||||||||||
| 7 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 7 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 7 | ▶ | use English qw(-no_match_vars); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 7 | our $VERSION = q[2026.07.25]; | |||||||||
| 13 | |||||||||||
| 14 | 35 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | 35 | my ($class, $ref) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 35 | ▶ | if(!$ref) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 28 | $ref = {}; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 35 | bless $ref, $class; | |||||||||
| 22 | |||||||||||
| 23 | 35 | return $ref; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 3 | ▶ | sub dyn_use { | ||||||||
|
Subroutine
dyn_use: called CC=3 SCAR=11.8
Pod
documented
| |||||||||||
| 27 | 3 | my( $self, $classname ) = @_; | |||||||||
| 28 | 3 | ▶ | my( $parent_namespace, $module ) = $classname =~ /^(.*?)([^:]+)$/smx ? ($1, $2) : (q[::], $classname); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | # { | ||||||||||
| 31 | # no strict 'refs'; ## no critic (ProhibitNoStrict) | ||||||||||
| 32 | # if($parent_namespace->{$module.q[::]}) { | ||||||||||
| 33 | #carp qq[$classname already loaded (${module}:: in $parent_namespace)]; | ||||||||||
| 34 | # return 1; | ||||||||||
| 35 | # } | ||||||||||
| 36 | # } | ||||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | eval "require $classname" or do { croak $EVAL_ERROR }; ## no critic qw(ProhibitStringyEval) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 3 | $classname->import(); | |||||||||
| 40 | |||||||||||
| 41 | 3 | return 1; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 7 | 1; | |||||||||
| 45 | __END__ | ||||||||||