line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Getopt::Kingpin::Type::Num; |
2
|
1
|
|
|
1
|
|
18
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
72
|
|
6
|
1
|
|
|
1
|
|
6
|
use Scalar::Util 'looks_like_number'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
155
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "0.10"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub set_value { |
11
|
4
|
|
|
4
|
1
|
7
|
my $self = shift; |
12
|
4
|
|
|
|
|
8
|
my ($value) = @_; |
13
|
|
|
|
|
|
|
|
14
|
4
|
100
|
|
|
|
22
|
if (looks_like_number($value)) { |
15
|
|
|
|
|
|
|
# ok |
16
|
|
|
|
|
|
|
} else { |
17
|
1
|
|
|
|
|
62
|
printf STDERR "num parse error\n"; |
18
|
1
|
|
|
|
|
10
|
return undef, 1; |
19
|
|
|
|
|
|
|
} |
20
|
3
|
|
|
|
|
10
|
return $value; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
__END__ |