Ok, I am trying to fix the broken tests in DateTime::Event::NameDay
and am getting the error 'Span cannot start after the end in
DateTime::Span->from_datetimes'. However my span looks perfectly
valid...
So I boiled it down to a simple test case:
--
#!/usr/local/lib/perl -w
use strict;
use DateTime;
use DateTime::Span;
use DateTime::Calendar::Christian;
my $dt1 = DateTime->new
( year => 1752,
month => 1,
day => 1,
);
my $dt2 = DateTime::Calendar::Christian->new
( year => 1755,
month => 1,
day => 3,
reform_date => $dt1,
);
my $sp = DateTime::Span->new(start => $dt1, end => $dt2);
--
This gives me two types of error:
--
Use of uninitialized value in numeric ne (!=) at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DateTime.pm line 1174.
Use of uninitialized value in numeric comparison (<=>) at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DateTime.pm line 1174.
Span cannot start after the end in DateTime::Span->from_datetimes
--
What am I doing wrong? (This is using the latest CVS versions of
things) and the relevant lines from DateTime.pm are:
-- (> marks line 1174).
foreach my $component ( qw( utc_rd_days utc_rd_secs rd_nanosecs ) )
{
> return $dt1->{$component} <=> $dt2->{$component}
if $dt1->{$component} != $dt2->{$component};
}
--
Thanks,
-ben