blue0ne has asked for the wisdom of the Perl Monks concerning the following question:
This lowly monk wishes to undesrtand why it is that eval {} is not impervious to the evil ones mightiest weapon Broken Pipe. In the following snippet from the incantation of an SSL server, if the commoner who is browsing said server hits the STOP button on their browser prior to the full buffer lentgh of information being transmitted, the SSL server is terminated by the evil Broken Pipe. I wish to save the towns people from such a fate and to trap this evil monster, and properly handle him by locking him in a cage, and gracefully letting the browsing commoner go, without the SSL server facing a quick fate. Any wisdom would be greatly appreciated blue0ne@digitz.org
eval {
if( !( print_errs( $got = Net::SSLeay::ssl_read_all ($ssl)))){
if ( $got ne ''){
Net::SSLeay::ssl_write_all($ssl, $got) or die "$$: ssl write
failed";
print "$got\n";
}
}
} || print "ERRORZ\n"; #I never get here due to an untrapable broken pipe error