Ported to perl. Doesn't send email yet.
Use Date::Calc for real date math. Many other enhancements too.