Perl DateTime Project 30

Recurrences (cont)

my $recur =
    DateTime::Event::Recurrence->weekly
        ( days => [ 1 .. 5 ] );
my $end =
    DateTime->new( year => 2006, month => 11 )
            ->subtract( days => 1 );
my @list =
    $recur->as_list( start => DateTime->today, 
                     end => $end );
for my $dt (@list) {
    print "\n" if $dt->day_of_week == 1;
    print sprintf( " %-9s - %s\n",
                   $dt->day_name, $dt->date );
}