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

perl -e 'print "'ello world\n" or die $!' > file_on_fs_that_is_already_full

I still wonder if that would error if the buffer weren't flushed though. It at least makes it more likely especially as the default also puts an `or die $!` on the close() op. There isn't anything to be done about implicit closes though.


An update. It has been suggested that I patch perl so that failures during implicit closes throw warnings, probably in the 'io' class.

Replies are listed 'Best First'.
Re^3: Initial Devel::UncheckedOps, a macro for perl
by Mr. Muskrat (Canon) on Jun 18, 2004 at 15:41 UTC
    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.
      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?