Crontab(3pm)
πΈ Crontab(3pm) πΈ
okay bestie, gather round, because this one is a lil Perl module called Set::Crontab and it lives in the User Contributed Perl Documentation (that's the 3pm part, iykyk). It does one thing and it does it beautifully: it takes those crontab-style integer lists and actually expands them so you can mess with them like a normal person. β¨
π NAME π
Set::Crontab β expand crontab(5)-style integer lists. that's it. that's the whole job. and she ate. π
β¨ SYNOPSIS β¨
$s = Set::Crontab->new("1-9/3,>15,>30,!23", [0..30]);
if ($s->contains(3)) { ... }
likeβ¦ look at her. a whole set of numbers from one tiny string. obsessed. π
π¦ DESCRIPTION π¦
Set::Crontab parses crontab-style lists of integers, and then it defines some utility functions so dealing with them is not a whole ordeal. main character energy fr fr.
π Syntax π
Numbers, ranges, *, and step values all work exactly as described in crontab(5). no cap, same rules. but there are a few extensions to the standard syntax, and those are the spicy bits β here they are:
π < and >
<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. symmetrical queens. π
π !
!N excludes N from the set. Here's the tea tho β it applies to the other specified range; otherwise it applies to the specified ranges.
so like, !3 with a range of 1-10 corresponds to 1-2,4-10. but >3,!7 in that same range means 4-6,8-10. the vibes are immaculate, the logic is precise. π«Ά
π§ Functions π§
β new($spec, [@range])
Creates a new Set::Crontab object and returns a reference to it. your lil baby set. born. π±
β contains($num)
Returns true if $num exists in the set. yes or no bestie, no in-between. π
β list()
Returns the expanded list corresponding to the set. Elements are in ascending order, because we are organized in this house. πβ¨
β οΈ okay important: the functions described above croak if they are called with incorrect arguments. so don't come at her with bad input, she will yell. π
π SEE ALSO π
π AUTHOR π
Abhijit Menon-Sen <ams@toroid.org>
Copyright 2001 Abhijit Menon-Sen <ams@toroid.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π this gorgeous thing is from perl v5.32.0, dated 2021-01-04, and it's the Crontab(3pm) page β she's been iconic since 2001 and she's still serving. go forth and expand your integer lists, you got this π¦πΈβ¨
π¦ where this page comes from
- debian bookworm: libset-crontab-perl 1.03-1.1
- debian trixie: libset-crontab-perl 1.03-1.1
- ubuntu jammy: libset-crontab-perl 1.03-1.1
- ubuntu noble: libset-crontab-perl 1.03-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms