As apl suggests, there are several modules on CPAN to manipulate dates and times. One is DateTime which you could use like this:
use DateTime;
my $d = new DateTime(year => 2008, month => 3, day => 31);
my $yesterday = DateTime->today()->add(days => -1);
while (1) {
my $year = $d->year;
my $month = $d->month;
my $day => $d->day;
... download file for $year, $month, $day ...
last if ($d->ymd('/') eq $yesterday->ymd('/'));
$d->add(days => 1);
}
|