C
Charles DeRykus
Thanks for raising the issue. After suffering a severe exit woundthat takes care of it most of the time....
[snipped]
However, the automatic closing does not die or warn upon failure.
If you open an actual file for reading, this probably isn't a problem,
but if you open a pipe command, it can be. Since one of the things I like
about perl the ready ability to change file opens into pipe opens, I am
careful to avoid situations where doing just that would create hard to find
bugs.
once when a partition filled, I have great affinity for T.Christ's
Cookbook advise:
"Those implicit closes are for convenience, not stability,
because they don't tell you whether the system call
succeeded or failed. Not all closes succeed. Even a
close on a read-only file can fail. For instance, you
could lose access to the device because of a network
outage. It's even more important to check the close if
the file was opened for writing. Otherwise you wouldn't
notice if the disk filled up."