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