line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::is_valid_isbn; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
352269
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
191
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
741
|
use Business::ISBN; |
|
1
|
|
|
|
|
29099
|
|
|
1
|
|
|
|
|
52
|
|
8
|
1
|
|
|
1
|
|
9
|
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
|
23729
|
my ($self, $var) = @_; |
16
|
4
|
|
|
|
|
19
|
"(is_value(${var}) && Business::ISBN->new(${var}) && Business::ISBN->new(${var})->is_valid)"; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Catmandu::Fix::Condition::is_valid_isbn - condition on validity of isbn numbers |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
if is_valid_isbn(isbn_field) |
26
|
|
|
|
|
|
|
... |
27
|
|
|
|
|
|
|
else |
28
|
|
|
|
|
|
|
... |
29
|
|
|
|
|
|
|
end |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SEE ALSO |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
L<Catmandu::Fix> |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |