Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Are you suggesting that that might be able to detect a filehandle "gone bad"? My problem is not that the open fails, but that the filehandle goes bad (apparently being closed by the child) some time after opening.

I see now what you mean, my assumption from the "Detect whether a writeable filehandle has closed?" was that you're looking at the filehandle on your end, but you're asking about the other end of the pipe. Sorry, fileno doesn't help with that, only if your filehandle closes (i.e. $pipe in your example here).

You might want to look at IPC::Run, it has a pumpable method that seems more like what you're asking for. I've also used its pump_nb method inside an eval to detect when a child process has gone bad.

Minor edits.


In reply to Re^3: Detect whether a writeable filehandle has closed? by haukex
in thread Detect whether a writeable filehandle has closed? by jdporter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found