line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::issn; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
103472
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
190445
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
810
|
use Business::ISSN; |
|
1
|
|
|
|
|
1453
|
|
|
1
|
|
|
|
|
42
|
|
7
|
1
|
|
|
1
|
|
8
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
942
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
921
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub emit_value { |
15
|
5
|
|
|
5
|
0
|
14862
|
my ($self, $var) = @_; |
16
|
5
|
|
|
|
|
24
|
"${var} = Business::ISSN->new(${var})->as_string if is_value(${var}) && length(${var});"; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Catmandu::Fix::issn - normalize the issn value for a given key |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Normalize the ISSN value of issn_field. |
26
|
|
|
|
|
|
|
# e.g. issn_field => '1553667x' |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
issn(issn_field) # issn_field => '1553-667X' |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SEE ALSO |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
L<Catmandu::Fix> |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |