| DateTime-Event-MultiCron documentation | Contained in the DateTime-Event-MultiCron distribution. |
DateTime::Event::MultiCron - Perl extension for DateTime::Event::Cron
use DateTime::Event::MultiCron;
my $dts=DateTime::Event::MultiCron->from_multicron('*/5 * * * *','*/2 * * * 6');
my $iter=$dts->iterator(after=>DateTime->now());
while (1) {
my $next = $iter->next;
print $next->datetime,"\n";
}
This module is an extension to DateTime::Event::Cron. It only adds the method from_multicron.
From multicron gets several schedule definition on the cron format, and returns a DateTime::Set for all that schedules. See example in the SYNOPSIS.
Stub documentation for DateTime::Event::MultiCron, created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited.
Blah blah blah.
L<DateTime::Event::Cron>
Marco Neves, <neves@cpan.org>
Copyright (C) 2007 by Marco Neves
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| DateTime-Event-MultiCron documentation | Contained in the DateTime-Event-MultiCron distribution. |
package DateTime::Event::MultiCron; use strict; use warnings; require Exporter; use base 'DateTime::Event::Cron'; our $VERSION = '0.01'; sub from_multicron { my $class=shift; my $dts=undef; while (my $cron=shift) { my $dtc=$class->new($cron); my $tdts=$dtc->as_set(); if ($dts) { $dts=$dts->union($tdts); } else { $dts=$tdts; } } return $dts; } 1; __END__ # Below is stub documentation for your module. You'd better edit it!