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

Re: Detect whether a writeable filehandle has closed?

by salva (Canon)
on Jan 15, 2021 at 12:04 UTC ( [id://11126954]=note: print w/replies, xml ) Need Help??


in reply to Detect whether a writeable filehandle has closed?

Even if it were possible to check whether the pipe was still valid before writing to it, doing it would be a bad idea. You would be introducing a race condition as the child could die after you check the pipe but before the write operation is completed. In general, that's a bad programming practice.

The right think to do is to catch the signal or the error (see ikegami's post above).

  • Comment on Re: Detect whether a writeable filehandle has closed?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found