Crontab(3pm)

πŸ“¦
version 1.03 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

🌸 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