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