line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Value::Identifier; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
18146
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
500
|
use Moo; |
|
1
|
|
|
|
|
10691
|
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
1666
|
use namespace::clean; |
|
1
|
|
|
|
|
8880
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'MooX::Value'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _why_invalid |
13
|
|
|
|
|
|
|
{ |
14
|
16
|
|
|
16
|
|
16
|
my ($self, $value) = @_; |
15
|
16
|
100
|
|
|
|
32
|
return (__PACKAGE__ . ': No identifier supplied', '', undef) unless defined $value; |
16
|
15
|
100
|
|
|
|
30
|
return (__PACKAGE__ . ': Empty identifier supplied', '', undef) unless length $value; |
17
|
14
|
100
|
|
|
|
37
|
return (__PACKAGE__ . ': Invalid initial character', '', undef) unless $value =~ m/\A[a-zA-Z_]/; |
18
|
12
|
100
|
|
|
|
38
|
return (__PACKAGE__ . ': Invalid character in identifier', '', undef) |
19
|
|
|
|
|
|
|
unless $value =~ m/\A[a-zA-Z_][a-zA-Z0-9_]*\z/; |
20
|
11
|
|
|
|
|
19
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
__END__ |