$hash{key1} = 'value';
is( $hash{key1}, 'value', 'Set and retrieved key1' );
+ tied( %hash )->_get_self->_storage->close( tied( %hash )->_get_self );
}
{
is( keys %hash, 1, "There's one key so far" );
ok( exists $hash{key1}, "... and it's key1" );
+ tied( %hash )->_get_self->_storage->close( tied( %hash )->_get_self );
}
{
file => $filename,
type => DBM::Deep->TYPE_ARRAY,
};
+ tied( @array )->_get_self->_storage->close( tied( @array )->_get_self );
} qr/DBM::Deep: File type mismatch/, "\$SIG_TYPE doesn't match file's type";
}
{
my ($fh, $filename) = new_fh();
- DBM::Deep->new( file => $filename, type => DBM::Deep->TYPE_ARRAY );
+ my $db = DBM::Deep->new( file => $filename, type => DBM::Deep->TYPE_ARRAY );
throws_ok {
tie my %hash, 'DBM::Deep', {
type => DBM::Deep->TYPE_HASH,
};
} qr/DBM::Deep: File type mismatch/, "\$SIG_TYPE doesn't match file's type";
+ $db->_get_self->_storage->close( $db->_get_self );
}