Expand crontab(5)-style integer lists
$s = Set::Crontab->new(\*(L"1-9/3,>15,>30,!23\*(R", [0..30]);
if ($s->contains\|(3)) { ... }
Set::Crontab parses crontab-style lists of integers and defines some utility functions to make it easier to deal with them.
Numbers, ranges, *, and step values all work exactly as described in crontab\|(5). A few extensions to the standard syntax are described below.
<N selects the elements smaller than N from the entire range, and adds them to the set. >N does likewise for elements larger than N.
!N excludes N from the set. It applies to the other specified range; otherwise it applies to the specified ranges (i.e. \*(L"!3\*(R" with a range of \*(L"1-10\*(R" corresponds to \*(L"1-2,4-10\*(R", but \*(L">3,!7\*(R" in the same range means \*(L"4-6,8-10\*(R").
Creates a new Set::Crontab object and returns a reference to it.
Returns true if $num exists in the set.
Returns the expanded list corresponding to the set.
The functions described above croak if they are called with incorrect arguments.
crontab\|(5)
Abhijit Menon-Sen <[email protected]>
Copyright 2001 Abhijit Menon-Sen <[email protected]>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.