On Sat, 1 Jul 2023 at 23:08, Bram <p5p@perl.wizbit.be> wrote:
> > My preference would be what the system level operations do: namely,
> > each one (read, write, close) simply returns success or failure
> > according to whether it has succeeded or failed.
> I'm afraid that ship has sailed long ago:
> https://github.com/Perl/perl5/commit/e199e3bef188fd5eadcca420af186241e2773db1
> ```
> commit e199e3bef188fd5eadcca420af186241e2773db1
> Author: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
> Date: Thu Mar 10 17:42:54 2005 +0000
>
> Make the return value of close() depend not only on the success of the
> close itself, but also on whether the output stream had a previous
> error. From Jim Meyering <jim@meyering.net>, via Debian.
>
> p4raw-id: //depot/perl@24022
> ```
>
> (And changing that now would (also) be a breaking change)
>
Nice piece of code archaeology! Yes, my preference would indeed be
breaking a change of some standing :-( I wasn't aware of that
behaviour, which seems to be stated much more clearly in that commit
message than in the rather ambiguous perldoc entry for close().
(Perhaps that wording should be improved?)
In light of this it is, as you say, the close() after a print() on a
read-only filehandle case which is wrong, which isn't a new failure. I
will raise a new GH issue for that, but it's neither new nor urgent.
So should we close off #21187 and go ahead with the 5.38.0 release? Or
are there still problems with HPUX/AIX mentioned by Leon/Yves?