in reply to Changing dates

Whenever you do date calculations manually, you are making a big mistake. They are harder than you think, and you never get them quite right.

Thankfully there are many well tested modules on CPAN for that, for example DateTime, Date::Manip, Date::Calc.

If you just want to deal with days, and never with times, Date::Simple can really be recommended, it uses a super-easy interfaces probably does exactly what you want (whatever it is) very easily.