line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Time::DaysInMonth; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
121
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require 5.000; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
8
|
|
|
|
|
|
|
@EXPORT = qw(days_in is_leap); |
9
|
|
|
|
|
|
|
@EXPORT_OK = qw(%mltable); |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION %mltable); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
210
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$VERSION = 99.1117; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
CONFIG: { |
18
|
|
|
|
|
|
|
%mltable = qw( |
19
|
|
|
|
|
|
|
1 31 |
20
|
|
|
|
|
|
|
3 31 |
21
|
|
|
|
|
|
|
4 30 |
22
|
|
|
|
|
|
|
5 31 |
23
|
|
|
|
|
|
|
6 30 |
24
|
|
|
|
|
|
|
7 31 |
25
|
|
|
|
|
|
|
8 31 |
26
|
|
|
|
|
|
|
9 30 |
27
|
|
|
|
|
|
|
10 31 |
28
|
|
|
|
|
|
|
11 30 |
29
|
|
|
|
|
|
|
12 31); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub days_in |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
# Month is 1..12 |
35
|
10
|
|
|
10
|
0
|
17
|
my ($year, $month) = @_; |
36
|
10
|
50
|
|
|
|
49
|
return $mltable{$month+0} unless $month == 2; |
37
|
0
|
0
|
|
|
|
|
return 28 unless &is_leap($year); |
38
|
0
|
|
|
|
|
|
return 29; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub is_leap |
42
|
|
|
|
|
|
|
{ |
43
|
0
|
|
|
0
|
0
|
|
my ($year) = @_; |
44
|
0
|
0
|
|
|
|
|
return 0 unless $year % 4 == 0; |
45
|
0
|
0
|
|
|
|
|
return 1 unless $year % 100 == 0; |
46
|
0
|
0
|
|
|
|
|
return 0 unless $year % 400 == 0; |
47
|
0
|
|
|
|
|
|
return 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |