| 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
|
|
109
|
use 5.010_000; |
|
|
6
|
|
|
|
|
21
|
|
|
9
|
6
|
|
|
6
|
|
34
|
use strict; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
134
|
|
|
10
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
|
6
|
|
|
|
|
23
|
|
|
|
6
|
|
|
|
|
191
|
|
|
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.12_01'; # TRIAL VERSION: generated by DZP::OurPkgVersion |
|
25
|
|
|
|
|
|
|
|
|
26
|
6
|
|
|
6
|
|
53
|
use Log::Any qw{$log}; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
53
|
|
|
27
|
6
|
|
|
6
|
|
1251
|
use Params::Validate qw(:all); |
|
|
6
|
|
|
0
|
|
22
|
|
|
|
6
|
|
|
|
|
3072
|
|
|
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
|
|
|
|
|
2858
|
my ($group_name) = $params{'character_group'} =~ /\[:([[:graph:]]+):\]/msx; |
|
38
|
254
|
|
|
|
|
3949
|
$log->tracef('group_name=%s;', $group_name); |
|
39
|
254
|
100
|
|
|
|
1050
|
if($group_name eq 'alpha') { return alpha(); } ## no critic (ControlStructures::ProhibitCascadingIfElse) |
|
|
254
|
50
|
|
|
|
19047
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
9
|
elsif($group_name eq 'alnum') { return alnum(); } |
|
41
|
0
|
|
|
|
|
0
|
elsif($group_name eq 'digit') { return digit(); } |
|
42
|
14
|
|
|
|
|
46
|
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
|
860
|
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
|
51
|
|
|
|
|
|
|
.'abcdefghijklmnopqrstuvwxyz'; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub alnum { |
|
56
|
3
|
|
|
0
|
1
|
11
|
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
|
54
|
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__ |