use warnings; use strict; use Time::Piece; my $t = Time::Piece->new(); my $lastmonth = $t->add_months(-1); print $lastmonth->strftime('%B'), "\n"; # Doesnt work #my $l_month_number = $lastmonth->strftime('%02d');