line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sweet::Now; |
2
|
2
|
|
|
2
|
|
4661407
|
use Moose; |
|
2
|
|
|
|
|
548900
|
|
|
2
|
|
|
|
|
15
|
|
3
|
2
|
|
|
2
|
|
9729
|
use namespace::autoclean; |
|
2
|
|
|
|
|
2107
|
|
|
2
|
|
|
|
|
9
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
538
|
use Time::Piece; |
|
2
|
|
|
|
|
21323
|
|
|
2
|
|
|
|
|
8
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has _localtime => ( |
8
|
|
|
|
|
|
|
default => sub { localtime() }, |
9
|
|
|
|
|
|
|
handles => [ qw( |
10
|
|
|
|
|
|
|
hour |
11
|
|
|
|
|
|
|
hms |
12
|
|
|
|
|
|
|
min |
13
|
|
|
|
|
|
|
mdy |
14
|
|
|
|
|
|
|
mon |
15
|
|
|
|
|
|
|
mday |
16
|
|
|
|
|
|
|
sec |
17
|
|
|
|
|
|
|
tzoffset |
18
|
|
|
|
|
|
|
year |
19
|
|
|
|
|
|
|
ymd |
20
|
|
|
|
|
|
|
) ], |
21
|
|
|
|
|
|
|
isa => 'Time::Piece', |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
required => 1, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
1
|
3
|
sub dd { sprintf "%02d", shift->mday } |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
1
|
0
|
sub hh { sprintf "%02d", shift->hour } |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
1
|
0
|
sub mi { sprintf "%02d", shift->min } |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
1
|
4
|
sub mm { sprintf "%02d", shift->mon } |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
1
|
0
|
sub ss { sprintf "%02d", shift->sec } |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
1
|
3
|
sub yyyy { sprintf "%04d", shift->year } |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
2
|
1
|
6
|
sub hhmiss { shift->hms('') } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub yyyymmddhhmiss { |
41
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
2
|
my $yyyymmdd = $self->yyyymmdd; |
44
|
1
|
|
|
|
|
28
|
my $hhmiss = $self->hhmiss; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
18
|
return "$yyyymmdd$hhmiss"; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
2
|
|
|
2
|
1
|
6
|
sub yyyymmdd { shift->ymd('') } |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
__END__ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Sweet::File |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SYNOPSIS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use Sweet::Now; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $now = Sweet::Now->new; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 _localtime |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Instance of L<Time::Piece>. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 METHODS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 dd |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 hh |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 hour |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Delegated to L</_localtime>. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 mi |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 min |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Delegated to L</_localtime>. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 mm |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 ss |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 hhmiss |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 tzoffset |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Delegated to L</_localtime>. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 year |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Delegated to L</_localtime>. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 yyyy |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 yyyymmdd |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 yyyymmddhhmiss |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|