in reply to Checking success of open() on file held in scalar ref.

I'd still check for an open failure for a couple of reasons.

  1. It's a strong habit. That is to say that I'd be checking for failure because I'm not really thinking about it.
  2. Future-proofing code (as already suggested by jbert). Just because I have nothing to fear today does not mean there will be nothing to fear tomorrow.
  3. It makes it easier to modify later. I may want to change it to use a real file. And then I may want to go back. I'd rather just have the die there all the time than keep adding and deleting it.
  4. I'm frequently surprised by things that don't work. In particular, it seems that open has many many special cases. Especially if my code has to deal with someone else's code, it's better to be defensive.
  • Comment on Re: Checking success of open() on file held in scalar ref.