If you are not using any of the Perl modules, you will be better off writing your own tailored to your requirements.
how is the best way to handle end-of-month/beginning-of-new-month changes, such as when $currentDay - 1 = 0 (the first of the month) because sometimes you then want it to = 30 and sometimes = 31 (or 28/29 for March 1st).
I'd done something similar in the past. I had written my own lastDayofMonth routine that also checked leap year. This is because we know in advance all possible
lastDayOfMonth values
$lastDay = lastDayOfMonth($month); #returns a number indicating last d
+ay
...
sub lastDayOfMonth
{
my $month=shift;
<sanity check here>
return 29 if($month==2 and isLeapYear($currYear));
<and so on>
}