line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Stardate; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
52046
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
111
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Acme::Stardate - Provide a simple 'stardate' string |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 20081029.16083 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '20081112.31792'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Acme::Stardate; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $t = stardate(); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
or from a command line |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
stardate |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 ABSTRACT |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
The Star Trek TV series started each episode with the stardate. Never mind that |
31
|
|
|
|
|
|
|
they don't make any sense. This module gives you a stardate of your very own. |
32
|
|
|
|
|
|
|
A stardate might be used as a version number. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 EXPORT |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
stardate |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
2
|
|
|
2
|
|
10
|
use Exporter 'import'; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
105
|
|
41
|
|
|
|
|
|
|
our @EXPORT = qw(stardate); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 FUNCTIONS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 stardate |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Returns a string yyyymmdd.fffff where yyyy is the four digit year, mm |
48
|
|
|
|
|
|
|
is the two digit month, dd is the two digit day of the month and .fffff |
49
|
|
|
|
|
|
|
is the 5 digit fraction of the current day. All times are GMT. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
2
|
|
7756
|
use POSIX 'strftime'; |
|
2
|
|
|
|
|
24660
|
|
|
2
|
|
|
|
|
15
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub stardate { |
56
|
2
|
|
|
2
|
1
|
1000678
|
strftime("%Y%m%d.", gmtime). int(time%86400/86400 * 100000) |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 AUTHOR |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Chris Fedde, C<< >> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 BUGS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
67
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
68
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SUPPORT |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
perldoc Acme::Stardate |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
You can also look for information at: |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=over 4 |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item * CPAN Ratings |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
L |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * Search CPAN |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
L |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=back |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Copyright 2008 Chris Fedde, all rights reserved. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
110
|
|
|
|
|
|
|
under the same terms as Perl itself. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
1; # End of Acme::Stardate |