File Coverage

blib/lib/Date/GoldenNumber.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             #$Header: /cvsroot/date-passover/lib/Date/GoldenNumber.pm,v 1.1 2001/08/05 11:52:46 rbowen Exp $
2             package Date::GoldenNumber;
3 3     3   21854 use strict;
  3         6  
  3         125  
4              
5             BEGIN {
6 3     3   12 use Exporter ();
  3         4  
  3         56  
7 3     3   13 use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
  3         7  
  3         340  
8 3     3   8 $VERSION = (qw'$Revision')[1];
9 3         29 @ISA = qw (Exporter);
10             #Give a hoot don't pollute, do not export more than needed by default
11 3         11 @EXPORT = qw (golden);
12 3         4 @EXPORT_OK = qw ();
13 3         218 %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 8     8 0 17 my $year = shift;
61 8         18 my $g = ( $year % 19 ) + 1;
62 8         18 return $g;
63             }
64              
65             1;
66