in reply to Want to use Date module

Am I using Date::Calc properly?
In the code you have shown, you are not using any of the functions of the Date::Calc module. Despite your inclusion of the module with use, you are not actually using the module. If you comment out that line, the code should run the same way.

Perl is interpreting your date as an integer value. So, '20090516' is really 20,090,516, and the for loop just iterates up to the next integer you specify, 20,090,602. Perl does not consider them dates.

You should calculate the number of days between your dates using one of the Delta_Days unctions provided by Date::Calc.