Set::I...rrence(3pm)
π Set::Infinite::_recurrence β the glow-up β¨
okay so bestie, this is the tea: it's Set::Infinite::_recurrence from the Perl User Contributed Documentation, dated 2026-02-15, version perl v5.42.2. it's an internal module, and we're gonna get into it.
πΈ NAME πΈ
Set::Infinite::_recurrence β literally extends Set::Infinite with recurrence functions. that's the whole vibe. periodt.
π SYNOPSIS π
$recurrence = $base_set->_recurrence ( \&next, \&previous );
like, that's the one-liner. chef's kiss.
π¦ DESCRIPTION π¦
bestie, listen. this is an internal class used by the DateTime::Set module. and the API? it's subject to change. so don't get too attached, okay? it's giving "we're not official yet."
what it does tho? it provides all the functionality that Set::Infinite has, plus it adds the ability to define recurrences with arbitrary objects β like dates and stuff. it ate, honestly. π₯
β¨ METHODS β¨
π _recurrence ( \&next, \&previous ) π
creates a recurrence set. and where does this set live? inside a 'base set', obviously. iconic behavior.
$recurrence = $base_set->_recurrence ( \&next, \&previous );
so these recurrence functions β they take one argument, and they return either the 'next' occurrence or the 'previous' occurrence. one job, and they do it.
example time, because i know you need one. this defines the set of all 'integer numbers':
use strict;
use Set::Infinite::_recurrence;
use POSIX qw(floor);
# define the recurrence span
my $forever = Set::Infinite::_recurrence->new(
Set::Infinite::_recurrence::NEG_INFINITY,
Set::Infinite::_recurrence::INFINITY
);
my $recurrence = $forever->_recurrence(
sub { # next
floor( $_[0] + 1 )
},
sub { # previous
my $tmp = floor( $_[0] );
$tmp < $_[0] ? $tmp : $_[0] - 1
},
);
print "sample recurrence ",
$recurrence->intersection( -5, 5 ), "\n";
# sample recurrence -5,-4,-3,-2,-1,0,1,2,3,4,5
{
my $x = 234.567;
print "next occurrence after $x = ",
$recurrence->{param}[0]->( $x ), "\n"; # 235
print "previous occurrence before $x = ",
$recurrence->{param}[2]->( $x ), "\n"; # 234
}
{
my $x = 234;
print "next occurrence after $x = ",
$recurrence->{param}[0]->( $x ), "\n"; # 235
print "previous occurrence before $x = ",
$recurrence->{param}[2]->( $x ), "\n"; # 233
}
like, look at it go. the outputs are right there in the comments β # 235, # 234, # 235, # 233. no cap, it's all laid out. π«Ά
π is_forever π
returns true if the set is a single span, ranging from -Infinity to Infinity. like, it goes on forever and ever, bestie. main character energy. βΎοΈ
π _is_recurrence π
returns true if the set is an unbounded recurrence, ranging from -Infinity to Infinity. same energy, different check. slay.
π CONSTANTS π
β INFINITY β
the "Infinity" value. that's it. that's the whole description. it's literally infinite and it knows it.
π NEG_INFINITY π
the "-Infinity" value. the negative version. the other side of the coin. still iconic.
π SUPPORT π
support is offered through the "datetime@perl.org" mailing list. so if you're stuck, that's where to go. and please β please β report bugs using rt.cpan.org. they want to know. fr fr. π
π§ AUTHOR π§
Flavio Soibelmann Glock <fglock@gmail.com> β the author. give them their flowers. π
and the recurrence generation algorithm? it's based on an idea from Dave Rolsky. so double the credit. respect. π«‘
π COPYRIGHT π
copyright (c) 2003 Flavio Soibelmann Glock. all rights reserved. this program is free software; you can distribute it and/or modify it under the same terms as Perl itself. so like, go off, but read the terms first.
the full text of the license can be found in the LICENSE file included with this module. it's all documented, bestie. no surprises.
π SEE ALSO π
Set::Infiniteβ the parent module, the origin story.DateTime::Setβ the module that uses this one, the reason it exists.
and for details on the Perl DateTime Suite project, please see <http://datetime.perl.org>. go explore, it's a whole world. π
and that's the whole manpage, bestie! π this was Set::Infinite::_recurrence β internal, subject to change, but absolutely serving. stay slay, and remember: perl v5.42.2, 2026-02-15. you're welcome. πβ¨
π¦ where this page comes from
- alpine 3.24: perl-datetime-set-doc 0.3900-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms