PlotCalendar::DateDesc - Perl extension for interpreting a file of periodic (like weekly) events and assigning actual dates to them. Used to feed the calendar plotting software.
require PlotCalendar::DateDesc; my ($month, $year) = (3,1999); # ---- set the month and year my $trans = PlotCalendar::DateDesc->new($month, $year); # ---- parse a description and return the day of the month my $day = 'first monday and third monday'; print "$day : ",join(',',@{$trans->getdom($day)}),"\n"; $day = 'last monday and third monday'; print "$day : ",join(',',@{$trans->getdom($day)}),"\n"; $day = 'last fri and third Monday'; print "$day : ",join(',',@{$trans->getdom($day)}),"\n"; # ---- parse a description and return the date as mm/dd/yyyy $day = 'last fri and third Monday'; print "$day dates: ", join(',',@{$trans->getdates($day)}),"\n"; What gets returned by both routines is a pointer to an array of answers
input descriptions may be one of : a day of the week (monday, tuesday, etc) a qualified day of the week (first monday, second tuesday, last sunday) compound statements are allowed : mon and wed, first mon and third mon Qualifiers are : first, second, third, fourth, fifth, last Compounds are only formed with 'and' and are not associative
Alan Jackson March 1999 ajackson@icct.net
PlotCalendar::Month PlotCalendar::Day
To install PlotCalendar::Day, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PlotCalendar::Day
CPAN shell
perl -MCPAN -e shell install PlotCalendar::Day
For more information on module installation, please visit the detailed CPAN module installation guide.