Alternatively, one can use "send" instead of "syswrite". Like this
In this case SIGPIPE is not provided, only EPIPE system error happens, which allows handling of all errors in single place.use Socket qw(MSG_NOSIGNAL); use Errno; my $out = send($sock, $data, MSG_NOSIGNAL); unless(defined $out) { if($!{EPIPE}) { warn("Got broken pipe\n"); } }
In reply to Re^3: Sockets, eval , and DIE
by andal
in thread Sockets, eval , and DIE
by Wiggins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |