FYI, if you want to use DateTime the way you were using it, there's clone:
#!/usr/bin/perl use DateTime; $dt = DateTime->now(); $month = $dt->clone->subtract(months => 1)->strftime("%m"); $year = $dt->clone->subtract(months => 1)->year(); print $dt."\n"; print $month."\n"; print $year."\n";
In reply to Re^3: Datetime Problem - Wrong Time
by tobyink
in thread Datetime Problem - Wrong Time
by solarisfire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |