From: rkinyon Date: Sat, 25 Feb 2006 02:32:58 +0000 (+0000) Subject: Added sigdie protection in all eval-blocks X-Git-Tag: 0-98~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2abc7b261c8201e279be68f0ebd382a5df7e48b9;p=dbsrgits%2FDBM-Deep.git Added sigdie protection in all eval-blocks --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 448ac86..2cedba0 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -210,6 +210,7 @@ sub _open { if (defined($self->fh)) { $self->_close(); } eval { + local $SIG{'__DIE__'}; # Theoretically, adding O_BINARY should remove the need for the binmode # Of course, testing it is going to be ... interesting. my $flags = O_RDWR | O_CREAT | O_BINARY; @@ -385,7 +386,7 @@ sub _add_bucket { # added ref() check first to avoid eval and runtime exception for every # scalar value being stored. performance tweak. - my $is_dbm_deep = ref($value) && eval { $value->isa( 'DBM::Deep' ) }; + my $is_dbm_deep = eval { local $SIG{'__DIE__'}; $value->isa( 'DBM::Deep' ) }; my $internal_ref = $is_dbm_deep && ($value->root eq $self->root);