develooper Front page | perl.perl5.porters | Postings from June 2013

perl needs safer implicit close

Thread Next
Ricardo Signes
June 11, 2013 22:30
perl needs safer implicit close
Message ID:

I promised that I'd write up the things that I think Perl most needs as
clear-cut changes that will still significantly improve working in Perl.  This
is the first thing I'm posting along those lines:

This is one of the things I would most like to see addressed in the next stable
release of perl.  We've got a five year old ticket about it.  I will decline to
speculate what that says about it getting done:

Tom's description there is, to nobody's surprise, thorough and on point.

Basically:  autovivified filehandles in lexical variables feel a *lot* easier
to use, and avoid package variables, which we try to discourage elsewhere for
various reasons.  The problem is that the list of reasons to use them sometimes
includes, "and you don't have to account for closing them, because they close
when the reference is destroyed!"  Yeah, they close, and the error status is
lost forever, like tears in rain.

We should issue a warning when an implicit close results in error.
can then fatalize that warning.  We should also fatalize errors on the implicit
close of the selected fh at END, to deal with errors during -i, for example.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About