simeon2000 offered a great solution, but I thought I'd point you in the direction of two excellent date-manipulation modules: Date::Calc (the link is to a gzipped archive which has a lot of useful calendar modules in it), and Date::Manip. I've used Date::Calc a number of times and find it a pleasure to work with. I've heard equally good things about Date::Manip.
If your date manipulation needs get any more complicated, or you just want to learn the ins and outs of a few useful modules, I'd highly suggest checking out the pods.
good luck with your project,