Hi edan,

Thanks for this information, it is very useful.

What I have realised is that I would like to take my system call functionality further.

At the moment, the way I have coded it is that the PERL script can gain control back when it has launched an external program/command or script with the system(<command>) or `<command>` method in the event of a timeout.

What I would like to do now is if the timeout is reached, I kill off the process that was launched.

I realised that I would need the PID and am not sure if it would be available from these methods. If the PID is not available from the above methods, what other method can I use to kill off an external program/command or script that PERL has launched once a timeout has reached? Would it be something like a spawn method or something like that?

If there is a Unix only solution to this, then I would still be interested. I mainly to initial testing on Windows, then move onto Red Hat Linux for proper testing and implementation.

Thanks,

Richard Thomas.

In reply to Re: Re: Re: Re: Re: Re: Passing function to a function using \&<function name> method by rich_d_thomas
in thread Passing function to a function using \&<function name> method by rich_d_thomas

Title:
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, details, 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, summary, 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.