Subject: | redefining __DIE__ causes an error when calculating the offset |
I use DateTime in a daemon, and for some reason when I redefine
$SIG{__DIE__} for debugging, it finds a fatal error:
-----------------
#!/usr/bin/perl
use DateTime;
$SIG{__DIE__} = sub
{
print "DIE! " . join(" ", @_);
exit;
};
my $sldt = DateTime->new( year => 2008,
month => 10,
day => 25,
hour => 7,
minute => 15,
second => 47,
time_zone => 'America/Chicago',
);
print $sldt->strftime('%z'), "\n";
------------
produces: DIE! Can't call method "isa" without a package or object
reference at /usr/local/share/perl/5.8.8/DateTime/TimeZone.pm line 492.
whereas removing it is fine:
------------
#!/usr/bin/perl
use DateTime;
my $sldt = DateTime->new( year => 2008,
month => 10,
day => 25,
hour => 7,
minute => 15,
second => 47,
time_zone => 'America/Chicago',
);
print $sldt->strftime('%z'), "\n";
------------
produces: -0500
This occurs on both debian linux and win32, using perl 5.8.8. Apologies
if it's been fixed in a more recent version, 0.41 is the latest I could
easily install.