line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MouseX::Types::Common::Numeric; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
71781
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
97
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
140
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.001000'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
|
|
20
|
use MouseX::Types -declare => [ |
9
|
|
|
|
|
|
|
qw(PositiveNum PositiveInt NegativeNum NegativeInt SingleDigit) |
10
|
2
|
|
|
2
|
|
992
|
]; |
|
2
|
|
|
|
|
1195
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
1615
|
use MouseX::Types::Mouse qw/Num Int/; |
|
2
|
|
|
|
|
309
|
|
|
2
|
|
|
|
|
15
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
subtype PositiveNum, |
15
|
|
|
|
|
|
|
as Num, |
16
|
|
|
|
|
|
|
where { $_ >= 0 }, |
17
|
|
|
|
|
|
|
message { "Must be a positive number" }; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
subtype PositiveInt, |
20
|
|
|
|
|
|
|
as Int, |
21
|
|
|
|
|
|
|
where { $_ >= 0 }, |
22
|
|
|
|
|
|
|
message { "Must be a positive integer" }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
subtype NegativeNum, |
25
|
|
|
|
|
|
|
as Num, |
26
|
|
|
|
|
|
|
where { $_ <= 0 }, |
27
|
|
|
|
|
|
|
message { "Must be a negative number" }; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
subtype NegativeInt, |
30
|
|
|
|
|
|
|
as Int, |
31
|
|
|
|
|
|
|
where { $_ <= 0 }, |
32
|
|
|
|
|
|
|
message { "Must be a negative integer" }; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
subtype SingleDigit, |
35
|
|
|
|
|
|
|
as PositiveInt, |
36
|
|
|
|
|
|
|
where { $_ <= 9 }, |
37
|
|
|
|
|
|
|
message { "Must be a single digit" }; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |