line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
6
|
|
116
|
use 5.010_000; |
|
6
|
|
|
|
|
21
|
|
9
|
6
|
|
|
6
|
|
33
|
use strict; |
|
6
|
|
|
|
|
24
|
|
|
6
|
|
|
|
|
129
|
|
10
|
6
|
|
|
6
|
|
31
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
175
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Global creator |
13
|
|
|
|
6
|
|
|
BEGIN { |
14
|
|
|
|
|
|
|
# Inherit nothing |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Global destructor |
18
|
|
|
|
6
|
|
|
END { |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# ABSTRACT: Base package (inherited) for IO::Iron::IronMQ/Cache/Worker::Policy packages. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our $VERSION = '0.13'; # VERSION: generated by DZP::OurPkgVersion |
25
|
|
|
|
|
|
|
|
26
|
6
|
|
|
6
|
|
40
|
use Log::Any qw{$log}; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
42
|
|
27
|
6
|
|
|
6
|
|
1286
|
use Params::Validate qw(:all); |
|
6
|
|
|
0
|
|
15
|
|
|
6
|
|
|
|
|
2961
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub group { |
32
|
0
|
|
|
254
|
1
|
0
|
my %params = validate( |
33
|
|
|
|
|
|
|
@_, { |
34
|
|
|
|
|
|
|
'character_group' => { type => SCALAR, regex => qr/^[[:graph:]]+$/msx, }, # character group name. |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
); |
37
|
254
|
|
|
|
|
2882
|
my ($group_name) = $params{'character_group'} =~ /\[:([[:graph:]]+):\]/msx; |
38
|
254
|
|
|
|
|
3776
|
$log->tracef('group_name=%s;', $group_name); |
39
|
254
|
100
|
|
|
|
971
|
if($group_name eq 'alpha') { return alpha(); } ## no critic (ControlStructures::ProhibitCascadingIfElse) |
|
254
|
50
|
|
|
|
18810
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
40
|
3
|
|
|
|
|
17
|
elsif($group_name eq 'alnum') { return alnum(); } |
41
|
0
|
|
|
|
|
0
|
elsif($group_name eq 'digit') { return digit(); } |
42
|
14
|
|
|
|
|
39
|
elsif($group_name eq 'lower') { return lower(); } |
43
|
0
|
|
|
|
|
0
|
elsif($group_name eq 'upper') { return upper(); } |
44
|
0
|
|
|
|
|
0
|
elsif($group_name eq 'word') { return word(); } |
45
|
0
|
|
|
|
|
0
|
else { return; } |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub alpha { |
50
|
237
|
|
|
3
|
1
|
827
|
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
51
|
|
|
|
|
|
|
.'abcdefghijklmnopqrstuvwxyz'; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub alnum { |
56
|
3
|
|
|
0
|
1
|
13
|
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
57
|
|
|
|
|
|
|
.'abcdefghijklmnopqrstuvwxyz' |
58
|
|
|
|
|
|
|
.'0123456789'; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub digit { |
63
|
0
|
|
|
14
|
1
|
0
|
return '0123456789'; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub lower { |
68
|
14
|
|
|
0
|
1
|
61
|
return 'abcdefghijklmnopqrstuvwxyz'; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub upper { |
73
|
0
|
|
|
0
|
1
|
|
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub word { |
78
|
0
|
|
|
0
|
1
|
|
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
79
|
|
|
|
|
|
|
.'abcdefghijklmnopqrstuvwxyz' |
80
|
|
|
|
|
|
|
.'0123456789_'; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |