use Date::Manip; # this is the current month my $current = ParseDate("today"); # or = ParseDate("january 2010") or whatever # now let's find the last day of the previous month $last_month_last_day = DateCalc(UnixDate($current, "%Y-%m"), "-1 day"); # then we print the interval print UnixDate($last_month_last_day, "01 %b %Y - %d %b %Y\n");