line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package dateheader; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
10999
|
use 5.00000; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
48
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
5
|
1
|
|
|
1
|
|
5
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
350
|
|
6
|
|
|
|
|
|
|
$VERSION='1.0'; |
7
|
|
|
|
|
|
|
my @days=qw/Sun Mon Tue Wed Thu Fri Sat/; |
8
|
|
|
|
|
|
|
my @months=qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub TIESCALAR{ |
11
|
1
|
|
|
1
|
|
2
|
my $x; |
12
|
1
|
|
|
|
|
4591
|
bless \$x; |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
sub FETCH{ |
15
|
1
|
|
|
1
|
|
121
|
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) |
16
|
|
|
|
|
|
|
= gmtime(time); |
17
|
|
|
|
|
|
|
#adjust date for printability: |
18
|
1
|
|
|
|
|
3
|
$year += 1900; |
19
|
|
|
|
|
|
|
# zero-pad time-of-day components |
20
|
1
|
|
|
|
|
5
|
$hour = substr("0$hour", -2); |
21
|
1
|
|
|
|
|
4
|
$min = substr("0$min", -2); |
22
|
1
|
|
|
|
|
3
|
$sec = substr("0$sec", -2); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# rfc 2822.3.3 says we should use -0000 but not all MUAs understand that |
25
|
|
|
|
|
|
|
return |
26
|
|
|
|
|
|
|
# "Date: $days[$wday], $mday $months[$mon] $year $hour:$min:$sec +0000"; |
27
|
1
|
|
|
|
|
10
|
"Date: $days[$wday], $mday $months[$mon] $year $hour:$min:$sec -0000"; |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# tie $dateheader, 'dateheader'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub import{ |
33
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
162
|
|
34
|
|
|
|
|
|
|
# *{caller().'::dateheader'} = $dateheader; |
35
|
1
|
|
|
1
|
|
6
|
tie ${caller().'::dateheader'}, 'dateheader'; |
|
1
|
|
|
|
|
8
|
|
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
__END__ |