-p does not check for failure of implicit print
Unlike modern incarnations of, say, awk and sed, perl -p does not check the
return status of the implicit print statement executed for each input
record.
Here's a patch against 5.004_01. ('ware wrapping: there's a long line
in it.) There's no test case: I couldn't think up a reliable,
portable and polite way of inducing a write error.
I think, in the specific case of the implicit print in -p, this is
non-controversial, and can go in the maintenance branch. That's not to say
that there are not programs using -p out there (probably CGI scripts) which
will surprise people by exiting noisily on encountering an error, rather
than continuing to do thewrong thing quietly. Does anybody know of any
widespread examples? Do we care?
More controversial error checking patch for implicit close of <ARGV>
to follow in separate bug report.
p5p-msgid: v
0311070aafea3fa83061@[194.51.248.75]