in reply to wishlist: die-on-failure for built-ins

While I agree that the return values from open() and chdir() should be checked, I can't agree that print() should be checked in the general case. There may be a few special circumstances where you would check it, but if confronted with a load of code saying:
print "hello world\n" || die "goodbye cruel world\n";
I think I'd want to strangle the author.

Replies are listed 'Best First'.
Re^2: wishlist: die-on-failure for built-ins
by tlm (Prior) on Apr 20, 2005 at 04:47 UTC

    Typically I don't check print's return value, but there are situations in which it is important to do so. E.g. one approach (described in perlipc) for dealing with PIPE errors is to set $SIG{ PIPE } to 'IGNORE' and detect PIPE errors by checking the return value of print.

    the lowliest monk