line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#$Header: /home/cvs/date-passover/lib/Date/GoldenNumber.pm,v 1.1 2001/08/05 11:52:46 rbowen Exp $ |
2
|
|
|
|
|
|
|
package Date::GoldenNumber; |
3
|
3
|
|
|
3
|
|
19719
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
107
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
BEGIN { |
6
|
3
|
|
|
3
|
|
14
|
use Exporter (); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
64
|
|
7
|
3
|
|
|
3
|
|
19
|
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
384
|
|
8
|
3
|
|
|
3
|
|
6
|
$VERSION = (qw'$Revision')[1]; |
9
|
3
|
|
|
|
|
36
|
@ISA = qw (Exporter); |
10
|
|
|
|
|
|
|
#Give a hoot don't pollute, do not export more than needed by default |
11
|
3
|
|
|
|
|
12
|
@EXPORT = qw (golden); |
12
|
3
|
|
|
|
|
5
|
@EXPORT_OK = qw (); |
13
|
3
|
|
|
|
|
172
|
%EXPORT_TAGS = (); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Date::GoldenNumber - Calculates the golden number used in John Conway's date calculations |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Date::GoldenNumber; |
23
|
|
|
|
|
|
|
$g = golden( 1992 ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Most of John Conway's date calculation algorithms need the golden |
28
|
|
|
|
|
|
|
number, which is Remainder(Y/19) + 1. Yes, this is very simple, but it |
29
|
|
|
|
|
|
|
is inconvenient to have to rember this. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SUPPORT |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
datetime@perl.org |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 AUTHOR |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Rich Bowen |
38
|
|
|
|
|
|
|
CPAN ID: RBOW |
39
|
|
|
|
|
|
|
rbowen@rcbowen.com |
40
|
|
|
|
|
|
|
http://www.rcbowen.com |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 COPYRIGHT |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Copyright (c) 2001 Rich Bowen. All rights reserved. |
45
|
|
|
|
|
|
|
This program is free software; you can redistribute |
46
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
The full text of the license can be found in the |
49
|
|
|
|
|
|
|
LICENSE file included with this module. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SEE ALSO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
perl |
54
|
|
|
|
|
|
|
Date::Easter |
55
|
|
|
|
|
|
|
Date::Passover |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub golden { |
60
|
3
|
|
|
3
|
0
|
13
|
my $year = shift; |
61
|
3
|
|
|
|
|
10
|
my $g = ( $year % 19 ) + 1; |
62
|
3
|
|
|
|
|
14
|
return $g; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|