use Date::Simple qw(date); my $d = date("2007-01-01"); $d++ until $d->day_of_week == 5; for (; $d le '2009-04-14'; $d += 7){ print $d, $/; }