in reply to Re: How to generate a report for last month
in thread How to generate a report for last month

use Date::Calc qw(Today Days_in_Month); my ($year, $month, $day) = Today(); return Days_in_Month($year,$month - 1);
That's not going to work in January. You should also import the Add_Delta_YMD function:
sub dayslastmonth { use Date::Calc qw(Today Days_in_Month Add_Delta_YMD); my ($year,$month,$day) = Add_Delta_YMD(Today(), 0, -1, 0); return Days_in_Month($year,$month); }
buckaduck