Subject: | bug in DateTime::Astro::Sunrise : invoking DateTime::new with invalid parameter |
Date: | Thu, 03 Jan 2008 16:35:32 +0800 |
To: | bug-DateTime-Astro-Sunrise [...] rt.cpan.org |
From: | LEE Sau Dan <leesaudan [...] gmail.com> |
This bug occurs in module DateTime::Astro::Sunrise version 0.01_01
(Mon Mar 17 10:01:50 2003).
I duplicated the example from the document, but changed the longtitude to
a positive number:
#/usr/bin/perl
use DateTime;
use DateTime::Astro::Sunrise;
my $dt = DateTime->new( year => 2000,
month => 6,
day => 20,
);
my $sunrise = DateTime::Astro::Sunrise ->new('118','33',undef,1);
my ($tmp_rise, $tmp_set) = $sunrise->sunrise($dt);
#end
But perl died at line 6, saying:
The 'minute' parameter ("-59") to DateTime::new did not pass the 'is between 0 and 59' callback
at /usr/lib/perl5/DateTime.pm line 175
DateTime::new('undef', 'year', 2000, 'month', 6, 'day', 20, 'hour', 22, ...) called at /usr/share/perl5/DateTime/Astro/Sunrise.pm line 105
DateTime::Astro::Sunrise::sunrise('DateTime::Astro::Sunrise=HASH(0x840df04)', 'DateTime=HASH(0x8150c28)') called at testing.pl line 12
$ uname -a
Linux somehost 2.6.22.1 #1 SMP PREEMPT Thu Jul 12 18:41:25 HKT 2007 i686 GNU/Linux
$ perl -v
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
Copyright 1987-2006, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
--
Lee Sau Dan 李守敦 ~{@nJX6X~}
Home page: http://www.informatik.uni-freiburg.de/~danlee