Subject: | eval to check for Hash::Util::FieldHash triggers __DIE__ signal handler |
I have a signal handler installed for __DIE__. When loading this module
it triggers the signal handler because of the eval to determine if
Hash::Util::FieldHash is present on the system.
H:U:FH is absent on older versions of Perl and this is a problem since
this module is used in Data::Printer.
Simple fix. USe Local() to set SIGDIE to IGNORE, per the patch.
Subject: | Hash_Util_FieldHash_Compat.pm.patch |
--- old/Hash_Util_FieldHash_Compat.pm 2013-02-27 15:22:16.000000000 -0500
+++ Hash_Util_FieldHash_Compat.pm 2013-02-27 15:22:21.000000000 -0500
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use constant REAL_FIELDHASH => do { local $@; eval { require Hash::Util::FieldHash } };
+use constant REAL_FIELDHASH => do { local $@; local($SIG{__DIE__}) = 'IGNORE'; eval { require Hash::Util::FieldHash } };
BEGIN {
if ( REAL_FIELDHASH ) {