If STDERR fails to close, what are you planning to do about it?

Checking [whether] standard error [closed in a Perl script], though, is a bit more problematic. After all, if STDERR fails to close, what are you planning to do about it? — The Perl Cookbook, 2nd Edition

They go on to suggest a couple of things, but it’s still a funny comment. By way of analogy, compare it to submitting a customer service request to a company saying that the customer service request system is not delivering any customer service requests.

On the very next page, it says “As of Perl v5.8 there is a way to mix [buffered and unbuffered I/O functions]: I/O layers. You can’t turn on buffering for the unbuffered functions, but you can turn off buffering for the unbuffered ones.” Great, really useful! I can turn off buffering on an unbuffered function and end up with: an unbuffered function! The presence of typos like this is really obnoxious, because when I find a confusing passage I have to wonder whether they are making a mistake or I’m just not understanding.

Leave A Comment...

CommentLuv badge