in reply to •Re: You *Can* Catch errors in closing lexical filehandles
in thread Catching errors in closing lexical filehandles

Exactly, that's why I mentioned stale values of $! and set it to undef in the scriptified version of the second paragraph.

It would have been better to do that right before exiting the scope of $fh. EAGAIN is sometimes possible during normal I/O.

After Compline,
Zaxo

  • Comment on Re^2: You *Can* Catch errors in closing lexical filehandles