Subject: | sample frequencies from Date::Manip::Recur don't appear to be working |
When it fails, I get the error, [frequency] Invalid frequency string at ./test_dmr.pl line 24.
Fails for these:
the first of every month
every other day
the 4th Thursday of each month
every other Friday
every 3 weeks on Thursday
Works for these:
every day
last Thursday of each month
# HERE'S MY TEST SCRIPT
#!/usr/local/bin/perl
use Date::Manip::Recur;
$recur = new Date::Manip::Recur;
my $base = '01/01/2010';
my $start = '01/01/2010';
my $end = '01/01/2011';
my @test_data = (
'the first of every month',
'every other day',
'the 4th Thursday of each month',
'every other Friday',
'every day',
'every 3 weeks on Thursday',
'last Thursday of each month',
'2nd Thursday of each month'
);
foreach my $td ( @test_data ) {
print "Test Data: $td\n";
my $err = $recur->parse( $td, $base, $start, $end );
warn $recur->err() if $err;
print join ",",
map {
$_->printf('%D')
} $recur->dates();
print "\n";
}