use Fcntl 'O_CREAT', 'O_RDWR', 'LOCK_EX';
require 5.005;
-$VERSION = "0.21";
+$VERSION = "0.50";
my $DEFAULT_MEMORY_SIZE = 1<<21; # 2 megabytes
my %good_opt = map {$_ => 1, "-$_" => 1}
sub DELETE {
my ($self, $n) = @_;
- $self->_delete_deferred($n) if $self->{defer};
my $lastrec = $self->FETCHSIZE-1;
my $rec = $self->FETCH($n);
+ $self->_delete_deferred($n) if $self->{defer};
if ($n == $lastrec) {
$self->_seek($n);
$self->_chop_file;
=head1 SYNOPSIS
- # This file documents Tie::File version 0.21
+ # This file documents Tie::File version 0.50
tie @array, 'Tie::File', filename or die ...;
=head1 LICENSE
-C<Tie::File> version 0.21 is copyright (C) 2002 Mark Jason Dominus.
+C<Tie::File> version 0.50 is copyright (C) 2002 Mark Jason Dominus.
This library is free software; you may redistribute it and/or modify
it under the same terms as Perl itself.
=head1 WARRANTY
-C<Tie::File> version 0.21 comes with ABSOLUTELY NO WARRANTY.
+C<Tie::File> version 0.50 comes with ABSOLUTELY NO WARRANTY.
For details, see the license.
=head1 THANKS
check_contents("0$:1$:2$:"); # deferred writes NOT flushed
expect($a[3], undef);
expect($a[2], "");
-exoect($del, "3");
+expect($del, "3");
$a[2] = "cookies";
$del = delete $a[2]; # shortens file!
expect($a[2], undef);
-exoect($del, 'cookies');
+expect($del, 'cookies');
check_contents("0$:1$:");
$a[0] = "crackers";
$del = delete $a[0]; # file unchanged
expect($a[0], "");
-exoect($del, 'crackers');
+expect($del, 'crackers');
check_contents("0$:1$:"); # no change yet
$o->flush;
check_contents("$:1$:"); # record 0 is NOT 'cookies';