sub close { my $self = shift; $self->NullError(); if (not defined $self->{'fh'}) { $self->Error("Can't close file that is not opened\n"); return 0; } $self->{'fh'}->close(); # remove what should be the last ref to the IO::File # object dropped into self on the open undef $self->{'fh'}; # original code called delete like this, may as well stay delete $self->{'fh'}; 1; }