use Scalar::Util ();
sub _get_self {
- eval { tied( @{$_[0]} ) } || $_[0]
+ eval { local $SIG{'__DIE__'}; tied( @{$_[0]} ) } || $_[0]
}
sub TIEARRAY {
use base 'DBM::Deep';
sub _get_self {
- eval { tied( %{$_[0]} ) } || $_[0]
+ eval { local $SIG{'__DIE__'}; tied( %{$_[0]} ) } || $_[0]
}
sub TIEHASH {
# DBM::Deep Test
##
use strict;
-use Test::More;
-
-my $max_keys = 4000;
-plan tests => 2;
+use Test::More tests => 2;
use_ok( 'DBM::Deep' );
##
# put/get many keys
##
+my $max_keys = 4000;
+
for ( 0 .. $max_keys ) {
$db->put( "hello $_" => "there " . $_ * 2 );
}
my $count = -1;
for ( 0 .. $max_keys ) {
$count = $_;
- unless( $db->get( $_ ) == $_ * 2 ) {
+ unless ( $db->get( $_ ) == $_ * 2 ) {
last;
};
}