2008/12/13 Elliot Shank <p...@galumph.com>: > Flavio S. Glock wrote: >> >> The intersects() method returns undef when it can't decide if there is >> an intersection. > > But why can't it decide and how can I get it to?
Proving that two unbounded (infinite) recurrences intersect is possible, but it is *really* difficult to implement a general case. You can help it decide by being more specific about the time range. If you specify a span, it will calculate if there is an intersection for that specific span: my $span_3 = DateTime::Span->from_datetimes( start => DateTime->new(year=>2001), before => DateTime->new(year=>2002) ); say 'span set intersected in 2001: ', $span_set_1->intersection($span_set_2)->intersects($span_3) ? 'yes' : 'no'; # span set intersected in 2001: yes ---