line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
our $VERSION = '0.15'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Catmandu::Sane; |
5
|
1
|
|
|
1
|
|
87036
|
use Business::ISBN; |
|
1
|
|
|
|
|
151419
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
643
|
use Moo; |
|
1
|
|
|
|
|
36098
|
|
|
1
|
|
|
|
|
39
|
|
7
|
1
|
|
|
1
|
|
7
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
8
|
1
|
|
|
1
|
|
703
|
|
|
1
|
|
|
|
|
775
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my ($self, $var) = @_; |
14
|
|
|
|
|
|
|
|
15
|
6
|
|
|
6
|
0
|
15896
|
qq| |
16
|
|
|
|
|
|
|
if (is_value(${var}) && length(${var})) { |
17
|
6
|
|
|
|
|
23
|
my \$isbn10 = Business::ISBN->new(${var})->as_isbn10; |
18
|
|
|
|
|
|
|
${var} = \$isbn10 ? \$isbn10->as_string : ''; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Catmandu::Fix::isbn10 - normalize the isbn value of a key in 10-digit form |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Normalize the ISBN value of isbn_field. |
30
|
|
|
|
|
|
|
# e.g. isbn_field => '1565922573' |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
isbn10(isbn_field) # isbn_field => '1-56592-257-3' |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SEE ALSO |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
L<Catmandu::Fix>, L<Catmandu::Fix::isbn13> |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |