use strict;
use warnings FATAL => 'all';
-my $class = Module::Build->subclass(
+my $build = Module::Build->subclass(
class => "Module::Build::Custom",
- code => <<'SUBCLASS' );
-
-sub ACTION_test {
- my $self = shift;
- if ( $self->notes('TEST_MYSQL_DSN') ) {
- $ENV{$_} = $self->notes($_) for qw(
- TEST_MYSQL_DSN TEST_MYSQL_USER TEST_MYSQL_PASS
- );
- }
- foreach my $name ( qw( LONG_TESTS TEST_SQLITE ) ) {
- $ENV{$name} = 1 if $self->notes( $name );
- }
+ code => '
+ sub prepare_metadata {
+ my $node = shift->SUPER::prepare_metadata(@_);
+ my $ver = $node->{version};
+ $_->{version} = $ver for values %{$node->{provides}};
+ $node;
+ }
- $self->SUPER::ACTION_test( @_ );
-}
-SUBCLASS
+ sub ACTION_test {
+ my $self = shift;
+ if ( $self->notes('TEST_MYSQL_DSN') ) {
+ $ENV{$_} = $self->notes($_) for qw(
+ TEST_MYSQL_DSN TEST_MYSQL_USER TEST_MYSQL_PASS
+ );
+ }
+ foreach my $name ( qw( LONG_TESTS TEST_SQLITE ) ) {
+ $ENV{$name} = 1 if $self->notes( $name );
+ }
-my $build = $class->new(
+ $self->SUPER::ACTION_test( @_ );
+ }
+ ',
+)->new(
module_name => 'DBM::Deep',
license => 'perl',
requires => {
-Revision history for DBM::Deep.
+Revision history for DBM::Deep (ordered by revision number).
1.0019_003 Jan XX XX:XX:00 2010 EST
(This is the third developer release for 1.0020.)
- Hopefully, this multi-engine support will allow deprecation of the file
format in the future.
+1.0016 Feb 05 22:10:00 2010 PST
+ - (This version is compatible with 1.0015)
+ - New caveat in the docs explaining stale references (RT#42129)
+ - All included modules now have the same version in META.yml, so
+ the CPAN shell will no longer try to downgrade.
+ - Fixed bug in clear() for hashes (RT#50541)
+
+1.0015 Jan 25 22:05:00 2010 PST
+ - (This version is compatible with 1.0014)
+ - Fix deep recursion errors (RT#53575)
+ - Avoid leaving temp files lying around (RT#32462)
+ - (RT #48031) Fixed bug with localized $, (Thanks, SPROUT!)
+
1.0014 Jun 13 23:15:00 2008 EST
- (This version is compatible with 1.0013)
- Fix for RT#36781 (t/44 has an unrequired dependency)
use strict;
use warnings FATAL => 'all';
-our $VERSION = q(1.0019_002);
+our $VERSION = q(1.0019_003);
use Scalar::Util ();
__PACKAGE__->_throw_error( "Unknown type for '$value'" );
}
- if ( eval { local $SIG{__DIE__}; $tied->isa( __PACKAGE__ ) } ) {
+ if ( eval { local $SIG{'__DIE__'}; $tied->isa( __PACKAGE__ ) } ) {
${$spot} = $tied->_repr;
$tied->_copy_node( ${$spot} );
}
sub begin_work {
my $self = shift->_get_self;
$self->lock_exclusive;
- my $rv = eval { $self->_engine->begin_work( $self, @_ ) };
+ my $rv = eval {
+ local $SIG{'__DIE__'};
+ $self->_engine->begin_work( $self, @_ );
+ };
my $e = $@;
$self->unlock;
die $e if $e;
sub rollback {
my $self = shift->_get_self;
$self->lock_exclusive;
- my $rv = eval { $self->_engine->rollback( $self, @_ ) };
+ my $rv = eval {
+ local $SIG{'__DIE__'};
+ $self->_engine->rollback( $self, @_ );
+ };
my $e = $@;
$self->unlock;
die $e if $e;
sub commit {
my $self = shift->_get_self;
$self->lock_exclusive;
- my $rv = eval { $self->_engine->commit( $self, @_ ) };
+ my $rv = eval {
+ local $SIG{'__DIE__'};
+ $self->_engine->commit( $self, @_ );
+ };
my $e = $@;
$self->unlock;
die $e if $e;
}
eval {
+ local $SIG{'__DIE__'};
$self->_engine->write_value( $self, $key, $value );
}; if ( my $e = $@ ) {
$self->unlock;
my $copy = $db->clone();
-B<Note>: Since clone() here is cloning the object, not the database location, any
-modifications to either $db or $copy will be visible to both.
+B<Note>: Since clone() here is cloning the object, not the database location,
+any modifications to either $db or $copy will be visible to both.
+
+=head2 Stale References
+
+If you take a reference to an array or hash from the database, it is tied
+to the database itself. This means that if the datum in question is subsequentl
+an invalid location and unpredictable things will happen if you try to use
+it.
+
+So a seemingly innocuous piece of code like this:
+
+ my %hash = %{ $db->{some_hash} };
+
+can fail if another process deletes or clobbers C<< $db->{some_hash} >>
+while the data are being extracted, since S<C<%{ ... }>> is not atomic.
+(This actually happened.) The solution is to lock the database before
+reading the data:
+
+ $db->lock_exclusive;
+ my %hash = %{ $db->{some_hash} };
+ $db->unlock;
=head2 Large Arrays
use strict;
use warnings FATAL => 'all';
-
-our $VERSION = $DBM::Deep::VERSION;
+no warnings 'recursion';
# This is to allow DBM::Deep::Array to handle negative indices on
# its own. Otherwise, Perl would intercept the call to negative
use strict;
use warnings FATAL => 'all';
-
-our $VERSION = $DBM::Deep::VERSION;
+no warnings 'recursion';
use DBM::Deep::Iterator ();
use strict;
use warnings FATAL => 'all';
-
-our $VERSION = $DBM::Deep::VERSION;
+no warnings 'recursion';
use base 'DBM::Deep';