Revision history for DBM::Deep.
+0.982 Mar 08 11:00:00 2006 Pacific
+ - Fixed smoketests that were failing on Win32
+ - Added restriction for Perl 5.6.0 or higher.
+ - Digest::MD5 and Sub::Uplevel (dep of Test::Exception) require 5.6+
+
0.981 Mar 06 11:00:00 2006 Pacific
- (RT#17947) - Fixed test that was failing on older Perls
use Scalar::Util ();
use vars qw( $VERSION );
-$VERSION = q(0.981);
+$VERSION = q(0.982);
##
# Set to 4 and 'N' for 32-bit offset tags (default). Theoretical limit of 4 GB per file.
##
sub TYPE_HASH () { SIG_HASH }
sub TYPE_ARRAY () { SIG_ARRAY }
-sub TYPE_SCALAR () { SIG_SCALAR }
sub _get_args {
my $proto = shift;
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;
-
- my $fh;
- sysopen( $fh, $self->_root->{file}, $flags )
- or $fh = undef;
- $self->_root->{fh} = $fh;
- }; if ($@ ) { $self->_throw_error( "Received error: $@\n" ); }
- if (! defined($self->_fh)) {
- return $self->_throw_error("Cannot sysopen file: " . $self->_root->{file} . ": $!");
- }
+ my $flags = O_RDWR | O_CREAT | O_BINARY;
- my $fh = $self->_fh;
+ my $fh;
+ sysopen( $fh, $self->_root->{file}, $flags )
+ or $self->_throw_error( "Cannot sysopen file: " . $self->_root->{file} . ": $!" );
- #XXX Can we remove this by using the right sysopen() flags?
- # Maybe ... q.v. above
- binmode $fh; # for win32
+ $self->_root->{fh} = $fh;
if ($self->_root->{autoflush}) {
my $old = select $fh;
return;
}
- unless ( _is_writable( $self->_fh ) ) {
+ if ( $^O ne 'MSWin32' && !_is_writable( $self->_fh ) ) {
$self->_throw_error( 'Cannot write to a readonly filehandle' );
}
ok($db->{hash}->{foo}->[1] eq 'b', "and get at stuff in the database");
ok( !$db->{foo}, "foo doesn't exist yet" );
-throws_ok {
- $db->{foo} = 1;
-} qr/Cannot write to a readonly filehandle/, "Can't write to a read-only filehandle";
+
+SKIP: {
+ skip "F_GETFL tests skipped on Win32", 1 if $^O eq 'MSWin32';
+ throws_ok {
+ $db->{foo} = 1;
+ } qr/Cannot write to a readonly filehandle/, "Can't write to a read-only filehandle";
+}
ok( !$db->{foo}, "foo doesn't exist yet" );