line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::is_valid_orcid; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
426790
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
188
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
813
|
use WWW::ORCID; |
|
1
|
|
|
|
|
4085
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
7
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::SimpleAllTest'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub emit_test { |
15
|
4
|
|
|
4
|
0
|
27758
|
my ($self, $var) = @_; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
21
|
"(is_value(${var}) && ${var} =~/^(\\d{4})-(\\d{4})-(\\d{4})-(\\d{3}[0-9X])\$/)"; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Catmandu::Fix::Condition::is_valid_orcid - checks of a field looks like an ORCID |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Checks is a field looks like an ORCID |
27
|
|
|
|
|
|
|
if is_valid_orcid(orcid) |
28
|
|
|
|
|
|
|
... |
29
|
|
|
|
|
|
|
else |
30
|
|
|
|
|
|
|
... |
31
|
|
|
|
|
|
|
end |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SEE ALSO |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
L<Catmandu::Fix> |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |