| 1 | package IO::Iron::PolicyBase::CharacterGroup; | ||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||
| 3 | ## no critic (Documentation::RequirePodAtEnd) | ||||||||||||||||||||||||||||||
| 4 | ## no critic (Documentation::RequirePodSections) | ||||||||||||||||||||||||||||||
| 5 | ## no critic (Subroutines::RequireArgUnpacking) | ||||||||||||||||||||||||||||||
| 6 | ## no critic (Variables::ProhibitPunctuationVars) | ||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||
| 8 | 6 | ▶ | use 5.010_000; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 9 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 10 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||
| 12 | # Global creator | ||||||||||||||||||||||||||||||
| 13 | ▶ | BEGIN { | |||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 14 | # Inherit nothing | ||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||
| 17 | # Global destructor | ||||||||||||||||||||||||||||||
| 18 | ▶ | END { | |||||||||||||||||||||||||||||
|
Subroutine
END: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||
| 22 | # ABSTRACT: Base package (inherited) for IO::Iron::IronMQ/Cache/Worker::Policy packages. | ||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||
| 24 | 6 | our $VERSION = '0.12_01'; # TRIAL VERSION: generated by DZP::OurPkgVersion | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||
| 26 | 6 | ▶ | use Log::Any qw{$log}; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 27 | 6 | ▶ | use Params::Validate qw(:all); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||
| 31 | sub group { | ||||||||||||||||||||||||||||||
| 32 | 254 | ▶ | my %params = validate( | ||||||||||||||||||||||||||||
|
Subroutine
group: called CC=7 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 33 | @_, { | ||||||||||||||||||||||||||||||
| 34 | 'character_group' => { type => SCALAR, regex => qr/^[[:graph:]]+$/msx, }, # character group name. | ||||||||||||||||||||||||||||||
| 35 | }, | ||||||||||||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||||||||||||
| 37 | 254 | my ($group_name) = $params{'character_group'} =~ /\[:([[:graph:]]+):\]/msx; | |||||||||||||||||||||||||||||
| 38 | 254 | $log->tracef('group_name=%s;', $group_name); | |||||||||||||||||||||||||||||
| 39 | 254 | ▶ | if($group_name eq 'alpha') { return alpha(); } ## no critic (ControlStructures::ProhibitCascadingIfElse) | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 40 | 0 | elsif($group_name eq 'alnum') { return alnum(); } | |||||||||||||||||||||||||||||
| 41 | 14 | elsif($group_name eq 'digit') { return digit(); } | |||||||||||||||||||||||||||||
| 42 | 0 | elsif($group_name eq 'lower') { return lower(); } | |||||||||||||||||||||||||||||
| 43 | 0 | elsif($group_name eq 'upper') { return upper(); } | |||||||||||||||||||||||||||||
| 44 | 0 | elsif($group_name eq 'word') { return word(); } | |||||||||||||||||||||||||||||
| 45 | 237 | else { return; } | |||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||
| 49 | sub alpha { | ||||||||||||||||||||||||||||||
| 50 | 3 | ▶ | return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | ||||||||||||||||||||||||||||
|
Subroutine
alpha: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 51 | .'abcdefghijklmnopqrstuvwxyz'; | ||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||
| 55 | sub alnum { | ||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | ||||||||||||||||||||||||||||
|
Subroutine
alnum: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 57 | .'abcdefghijklmnopqrstuvwxyz' | ||||||||||||||||||||||||||||||
| 58 | .'0123456789'; | ||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||
| 62 | sub digit { | ||||||||||||||||||||||||||||||
| 63 | 14 | ▶ | return '0123456789'; | ||||||||||||||||||||||||||||
|
Subroutine
digit: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||
| 67 | sub lower { | ||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | return 'abcdefghijklmnopqrstuvwxyz'; | ||||||||||||||||||||||||||||
|
Subroutine
lower: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||
| 72 | sub upper { | ||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||||||||||||||||||||||||||||
|
Subroutine
upper: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||
| 77 | sub word { | ||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | ||||||||||||||||||||||||||||
|
Subroutine
word: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 79 | .'abcdefghijklmnopqrstuvwxyz' | ||||||||||||||||||||||||||||||
| 80 | .'0123456789_'; | ||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||
| 83 | 6 | 1; | |||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||
| 85 | __END__ | ||||||||||||||||||||||||||||||