M
Mark
When I added a $SIG{__DIE__} handler to code that uses
$Time::Format::time{}, the sig die handler code is called. I believe
this is happening during the evaluation of $Time::Format::time{}.
Without a $SIG{__DIE__} handler defined the code runs to completion.
Here is some code that illustrates the issue on my Windows XP
workstation.
Is there something I am doing wrong that is causing the sig die to
occur?
use strict;
use warnings;
use Time::Format;
$| = 1;
# Comment out next line for alternate case
$SIG{'__DIE__'} = sub {print("I'm dying.... Reason:
$_[0]\n");exit(1);};
logit("debug output\n");
print "Alive and well after calling logit.\n";
exit;
sub logit {
print $Time::Format::time{'yyyymmdd:hh:mm:ss '}, $_[0];
}
__END__
Ouput for case with sig die handler specified:
I'm dying.... Reason: Can't locate I18N/Langinfo.pm in @INC (@INC
contains: D:/Perl/site/lib D:/Perl/lib .) at (eval 1) line 31, <DATA>
line 1.
Ouput for case with no sig die handler specified:
20100928:13:58:45 debug output
Alive and well after calling logit.
$Time::Format::time{}, the sig die handler code is called. I believe
this is happening during the evaluation of $Time::Format::time{}.
Without a $SIG{__DIE__} handler defined the code runs to completion.
Here is some code that illustrates the issue on my Windows XP
workstation.
Is there something I am doing wrong that is causing the sig die to
occur?
use strict;
use warnings;
use Time::Format;
$| = 1;
# Comment out next line for alternate case
$SIG{'__DIE__'} = sub {print("I'm dying.... Reason:
$_[0]\n");exit(1);};
logit("debug output\n");
print "Alive and well after calling logit.\n";
exit;
sub logit {
print $Time::Format::time{'yyyymmdd:hh:mm:ss '}, $_[0];
}
__END__
Ouput for case with sig die handler specified:
I'm dying.... Reason: Can't locate I18N/Langinfo.pm in @INC (@INC
contains: D:/Perl/site/lib D:/Perl/lib .) at (eval 1) line 31, <DATA>
line 1.
Ouput for case with no sig die handler specified:
20100928:13:58:45 debug output
Alive and well after calling logit.