Subject: | failure to keep internal filehandle value on read |
Date: | Wed, 4 Nov 2015 08:42:46 -0800 |
To: | bug-Config-Simple [...] rt.cpan.org |
From: | Matthew <llahwehttam [...] gmail.com> |
This issue was introduced in version 4.56 and is present in the current
version, 4.59.
The read method does not set the filehandle properly. There is a call to
$self->_get_fh but that method returns two values, so the call in the read
method:
$self->{_FILE_HANDLE} = $self->_get_fh($file,O_RDONLY) or return undef
should be
($self->{_FILE_HANDLE},undef) = $self->_get_fh($file,O_RDONLY);
return undef if (! defined($self->{_FILE_HANDLE}));
As a result of this issue the code is unable to close the file handle.
This means it is not possible to have a script which reads a config file
and then deletes it.
--
-------------------------------------
Matthew Hall llahwehttam@gmail.com