Date::Biorhythm - a biorhythm calculator
From the command line
biorhythm --birthday=1994-10-09
Usage
use Date::Biorhythm; my $bio = Date::Biorhythm->new({ birthday => Date::Calc::Object->new(0, 1970, 1, 1), name => 'Unix', }); my $i = 0; my $limit = 365; $bio->day(Date::Calc::Object->today); while ($i < $limit) { print $bio->value('emotional'), "\n"; $bio->next; $i++; }
I find biorhythms mildly amusing, but I got tired of visiting http://www.facade.com/biorhythm and having to deal with their web-based form for date entry.
I vaguely remembered there being a Perl module for biorhythm calculation, but I couldn't find it on CPAN. However, further investigation finally led me to BackPAN where I found Date::Biorhythm 1.1 which was written by Terrence Brannon (a long time ago).
Wanting an excuse to try Moose out, I decided to make a new and modernized version of Date::Biorhythm, and this is the result.
!http://i41.photobucket.com/albums/e271/sr5i/GoogleMotherFucker.jpg!
http://en.wikipedia.org/wiki/Biorhythm
This method was added by Moose, and it gives you access to Date::Biorhythm's metaclass. (See Moose for more details.)
The constructor. It takes on optional hashref that will accept the following keys: name, birthday, and day.
Get or set the name associated with this biorhythm. This will usually be a person's name.
Get or set the birthday used for this biorhythm.
Get or set the current day (which is represented by a Date::Calc::Object).
Go forward one day by incrementing $self->day.
Go backward one day by decrementing $self->day.
Given a primary cycle (such as 'emotional', 'intellectual', or 'physical'), return how many days we are into the cycle. Note that the first day of the cycle returns 0.
Given a primary cycle or secondary cycle, return a value between -1 and 1 that represents the current amplitude in the cycle.
http://www.facade.com/biorhythm
Terrence Brannon <metaperl@gmail.com>
John Beppu <beppu@cpan.org>
To install Date::Biorhythm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Date::Biorhythm
CPAN shell
perl -MCPAN -e shell install Date::Biorhythm
For more information on module installation, please visit the detailed CPAN module installation guide.