line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
25011
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
79
|
|
3
|
|
|
|
|
|
|
package Email::Date; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Email::Date::VERSION = '1.104'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: Find and Format Date Headers |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw[find_date format_date]; |
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw[format_gmdate]; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
15
|
use Exporter 5.57 'import'; |
|
1
|
|
|
|
|
24
|
|
|
1
|
|
|
|
|
42
|
|
13
|
1
|
|
|
1
|
|
1027
|
use Date::Parse 2.27 (); |
|
1
|
|
|
|
|
9487
|
|
|
1
|
|
|
|
|
43
|
|
14
|
1
|
|
|
1
|
|
968
|
use Email::Date::Format 1.000; |
|
1
|
|
|
|
|
559
|
|
|
1
|
|
|
|
|
43
|
|
15
|
1
|
|
|
1
|
|
1010
|
use Time::Piece 1.08 (); |
|
1
|
|
|
|
|
14166
|
|
|
1
|
|
|
|
|
228
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub find_date { |
19
|
5
|
|
|
5
|
1
|
7907
|
require Email::Abstract; |
20
|
5
|
|
|
|
|
44837
|
my $email = Email::Abstract->new($_[0]); |
21
|
|
|
|
|
|
|
|
22
|
5
|
|
100
|
|
|
897
|
my $date = $email->get_header('Date') |
23
|
|
|
|
|
|
|
|| _find_date_received($email->get_header('Received')) |
24
|
|
|
|
|
|
|
|| $email->get_header('Resent-Date'); |
25
|
|
|
|
|
|
|
|
26
|
5
|
100
|
66
|
|
|
226
|
return unless $date and length $date; |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
|
|
18
|
Time::Piece->new(Date::Parse::str2time $date); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _find_date_received { |
32
|
3
|
100
|
66
|
3
|
|
269
|
return unless defined $_[0] and length $_[0]; |
33
|
1
|
|
|
|
|
2
|
my $date = pop; |
34
|
1
|
|
|
|
|
8
|
$date =~ s/.+;//; |
35
|
1
|
|
|
|
|
6
|
$date; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
BEGIN { |
40
|
1
|
|
|
1
|
|
4
|
*format_date = \&Email::Date::Format::email_date; |
41
|
1
|
|
|
|
|
29
|
*format_gmdate = \&Email::Date::Format::email_gmdate; |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |