in reply to Detecting write errors (disk full, bad media)
However, if you use warnings, you will probably get a message to STDERR. I can not easily try the case where you have a full disk, but it is simple to try the case where you don't have permissions to write to a file.
If you want to die when a print fails, you would need to add this code:
Similarly, you could use autodie. UPDATE: As Anon correctly points out below, this can only be used for open/close, not print.print $filehandle "CCC\n" or die $!;
I believe eval should work as you have shown. What happens when you try it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detecting write errors (disk full, bad media)
by Anonymous Monk on Jun 30, 2011 at 15:20 UTC |