in reply to Re: <rant>CPAN modules failing to check for write errors</rant>
in thread <rant>CPAN modules failing to check for write errors</rant>

Printing to a file handle with insufficient disk space does not produce a failure, at least not on my system.

It does on some systems. I think it might on yours too if you have $| set or add some "\n"s to the output (I suspect the close is doing the final flush that's putting the file over the limit.)

I honestly don't see the point in checking print()'s return value. It puts in more code that will only happen for such extremely rare occasions that you can simply discount them.

This, of course, depends on how you feel about those rare occasions and the impact of data being lost. Some of my nastiest debugging sessions in the past have been dealing with exactly this sort of rare occasion and I would prefer people to take the care to die or whatever when they occurred.

(not that I think any sort of approval system for CPAN is the right way to go about fixing these sorts of problem)

  • Comment on Re: Re: <rant>CPAN modules failing to check for write errors</rant>

Replies are listed 'Best First'.
Re: Re: Re: <rant>CPAN modules failing to check for write errors</rant>
by hardburn (Abbot) on Jun 01, 2004 at 17:40 UTC

    Actually, I just realized something:

    $ perl -e ' > die ' Died at -e line 2.

    I mis-counted the lines in my example of printing to a file handle without enough space. The die was occuring at the print after all. I'm not sure if you can rely on this feature to be cross-platform (my particular system is Linux 2.6.5, glibc 2.3.2, Perl 5.8.2).

    ----
    send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.