in reply to Re^2: Initial Devel::UncheckedOps, a macro for perl
in thread Initial Devel::UncheckedOps, a macro for perl

I did not even think of that one. I was thinking that if someone used select to set the default filehandle then you might need to make a second pass through to figure out what filehandle is really being used.
  • Comment on Re^3: Initial Devel::UncheckedOps, a macro for perl

Replies are listed 'Best First'.
Re^4: Initial Devel::UncheckedOps, a macro for perl
by diotalevi (Canon) on Jun 18, 2004 at 18:10 UTC
    What does it matter which filehandle is being written to if an error is throw? I don't follow why you care whether the handle is named STDIN or is default.
      Because not being able to write to STDOUT usually means that there is something more serious than a script error. Right? Or has my brain gone soft this week of vacation?

        I think you were thinking of throwing errors on STDOUT not being a valid handle. If someone had closed it before or something. This generalizes the error checking to any error including such favorites as ENOSPC. It'll still throw errors if the handle being written to isn't valid. Heck, this is how I did most of my testing - checking against a print to an invalid handle. It was too inconvenient to keep a full file system around just for testing.

        print BAR "Hi!" or die $!; # Bad file descriptor at ...