"be consistent" | |
PerlMonks |
Re: Detecting write errors (disk full, bad media)by dcmertens (Scribe) |
on Jul 01, 2011 at 16:26 UTC ( [id://912374]=note: print w/replies, xml ) | Need Help?? |
I think the other monks have answered your question. BUT if you wanted to have the print statement croak when it encounters errors, you can override the standard output to go to a tied filehandle. Then operations that Perl would have sent to stdout go to your filehandle code. You could then have your filehandle code print its results to the old stdout, but check the return value for you.
For details, see http://stackoverflow.com/questions/387702/how-can-i-hook-into-perls-print
In Section
Seekers of Perl Wisdom
|
|