This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
-p does not check for failure of implicit print
authorDominic Dunlop <domo@slipper.ip.lu>
Sun, 15 Jun 1997 23:36:14 +0000 (11:36 +1200)
committerTim Bunce <Tim.Bunce@ig.co.uk>
Wed, 6 Aug 1997 12:00:00 +0000 (00:00 +1200)
commit08e9d68e93f9880dc9a1edcde3abb85026f49784
tree91b1649fae5e4a3033997482c0e2c988f8e0af20
parent7bc39d6220d2b77d9c5827625d97cd2af6ef9c56
-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: v0311070aafea3fa83061@[194.51.248.75]
pod/perldiag.pod
pod/perlrun.pod
toke.c