line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Untaint::isbn; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7384
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
4
|
use base 'CGI::Untaint::printable'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
809
|
|
5
|
|
|
|
|
|
|
require Business::ISBN; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1364
|
use vars qw/$VERSION/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
139
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub is_valid { |
11
|
10
|
|
|
10
|
1
|
5805
|
my $self = shift; |
12
|
10
|
|
|
|
|
24
|
my $isbn = $self->value; |
13
|
10
|
100
|
|
|
|
76
|
my $bi = Business::ISBN->new($isbn) or return; |
14
|
7
|
100
|
|
|
|
1411
|
return unless $bi->is_valid == 1; |
15
|
6
|
|
|
|
|
44
|
$self->value( $bi->as_string([]) ); |
16
|
6
|
|
|
|
|
109
|
return $self->value; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__END__ |