in reply to date span in YYYYMMDD

Basically, I think the code is correct, but what about the lengths of the months? (30, 31, 29, or 28 days). Maybe it doesn't matter for your application, but if it does you have to add code for dealing with those special cases.

Here is what I have written so far, I tried to do it using Date::Time, but I'm not familliar with the module.
Hmm. Maybe you should do some experimentation with Date::Time to see what it can do. Or look for other Date:: modules. Date::Calc looks promising for your problem.

Not being familiar with a module is not really a good reason to not use it. Experiment with it and maybe someday a problem comes by which you can solve with that module because you knew it existed and played around with it.

Arjen