Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Sockets, eval , and DIE

by Wiggins (Friar)
on Apr 17, 2014 at 17:45 UTC ( #1082669=note: print w/ replies, xml ) Need Help??


in reply to Re: Sockets, eval , and DIE
in thread Sockets, eval , and DIE

BINGO !!
SIGPIPE="IGNORE" allowed the code to continue. Now to wrestle with "Don't test for what you aren't prepared to handle!"

It is always better to have seen your target for yourself, rather than depend upon someone else's description.


Comment on Re^2: Sockets, eval , and DIE
Re^3: Sockets, eval , and DIE
by andal (Hermit) on Apr 22, 2014 at 06:27 UTC

    Alternatively, one can use "send" instead of "syswrite". Like this

    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 this case SIGPIPE is not provided, only EPIPE system error happens, which allows handling of all errors in single place.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-01 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (12 votes), past polls