Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Not sure if I follow what you mean, in the second case the reason it is more effective is not because of the pipe but because you store the process id of the child and send a sigkill to that child when you want it to die. I do agree that having a pipe is an unrequired overhead and seems a tad ugly for what you want to achieve. I would recomend that you drop back to basics and fork/exec your child. Fork will return the pid of the child to allow you to kill it later. Just keep in mind that if you start using fork/exec you need to keep track of zombie processes (all described in fork).

As an asside I would Strongly recomend that you do not use kill 9, this sends a sigkill to your child process. SigKill cannot be trapped by the process to allow clean sutdown. The chance that you will leave your child in a mess is high. Send sigquit (3) this is a nice gentle tap on the head requesting the child die. If you feel that it is important to ensure the child dies and you are concerned that the child may ignore sigquit then use waitpid to ensure that the process dies, send sigkill iFF the child refuses to die. --


In reply to Re: (Zigster) Timing out shell commands (paranoia) by zigster
in thread Timing out shell commands (paranoia) by bluto

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (4)
    As of 2017-11-18 21:59 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (278 votes). Check out past polls.