With DateTime, you can:
perl -MDateTime -E 'say DateTime->now->month' perl -MDateTime -E 'say DateTime->now->subtract(months=>1)->month'
The output (we're currently in July):
7 6
Dave
In reply to Re: get previous month in two digit number
by davido
in thread get previous month in two digit number
by Jim Wang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |