in reply to Re^3: Error parsing using Time::Piece
in thread Error parsing using Time::Piece

It seems that if I convert this line in my code from:
my $last_month_num = $t->add_months(-1)->mon;

to:
my $last_month_num = sprintf("%02d",$t->add_months(-1)->mon);

It should take care of the problem!