From: rkinyon Date: Fri, 17 Feb 2006 15:32:59 +0000 (+0000) Subject: Converted eof() from FileHandle method to builtin X-Git-Tag: 0-97~54 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=629df3a3b84490b907df436dc41d928c1843ef30;p=dbsrgits%2FDBM-Deep.git Converted eof() from FileHandle method to builtin --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 1b05968..1b5b209 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -340,18 +340,20 @@ sub _load_tag { my $self = shift; my $offset = shift; - seek($self->fh, $offset, 0); - if ($self->fh->eof()) { return undef; } + my $fh = $self->fh; + + seek($fh, $offset, 0); + if (eof $fh) { return undef; } my $sig; - read( $self->fh, $sig, SIG_SIZE); + read( $fh, $sig, SIG_SIZE); my $size; - read( $self->fh, $size, $DATA_LENGTH_SIZE); + read( $fh, $size, $DATA_LENGTH_SIZE); $size = unpack($DATA_LENGTH_PACK, $size); my $buffer; - read( $self->fh, $buffer, $size); + read( $fh, $buffer, $size); return { signature => $sig, @@ -1463,8 +1465,10 @@ sub CLEAR { ## $self->lock( LOCK_EX ); - seek($self->fh, $self->base_offset, 0); - if ($self->fh->eof()) { + my $fh = $self->fh; + + seek($fh, $self->base_offset, 0); + if (eof $fh) { $self->unlock(); return; }