$t->add_months(11-$t->mon)->month_last_day; #### use Date::Calc qw( Days_in_Month ); print Days_in_Month(2016,2);