line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::is_valid_orcid; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
365379
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
174
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
685
|
use WWW::ORCID; |
|
1
|
|
|
|
|
3337
|
|
|
1
|
|
|
|
|
23
|
|
8
|
1
|
|
|
1
|
|
6
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::SimpleAllTest'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub emit_test { |
15
|
4
|
|
|
4
|
0
|
24022
|
my ($self, $var) = @_; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
18
|
"(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; |