in reply to Re^5: Scoping question - will file handle be closed?
in thread Scoping question - will file handle be closed?

croak("E: Unable to close file handle for $file: $!"); This usually results in a nice explanation what went wrong.

Do you have, or can you point me at a list of the possibilities? Or even a few of them?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
  • Comment on Re^6: Scoping question - will file handle be closed?

Replies are listed 'Best First'.
Re^7: Scoping question - will file handle be closed?
by Monk::Thomas (Friar) on Jul 14, 2015 at 21:15 UTC
    Sorry, I don't have such a list. I just experienced that file write issue once. Another easy to provoke error is to close an already closed file handle. Apart from that... no clue.

      Given that close can only return 3 errors; and two of those shouldn't be possible in tested code;

      it's hard to see how croak("E: Unable to close file handle for $file: $!");

      can "results in a nice explanation what went wrong".


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!

        Maybe you are expecting something else? I find

        E: Unable to close file handle for /tmp/testfile: Bad file descriptor at /tmp/close_error.pl line 19.

        to be a nice explanation.