system() never returns, how to kill it?

Discussion in 'Perl Misc' started by Zhidian Du, Nov 25, 2003.

  1. Zhidian Du

    Zhidian Du Guest

    I am writing a cgi program.
    When I use system and it never returns. How can I kill it, for
    example, after 5 seconds?

    I searched the whole sites and cannot find it.

    Thanks.

    Z. Du
     
    Zhidian Du, Nov 25, 2003
    #1
    1. Advertising

  2. Zhidian Du

    Sisyphus Guest

    I. E. wrote:
    > On 25 Nov 2003 16:43:23 GMT, Abigail <> wrote:
    >
    > I tried using this method on Win32 but the system commnd still
    > executes as a background process and consumes resources. Is there any
    > way to kill it on Win32?
    >


    use Win32::process;

    if(!($process->Wait($milliseconds)) {
    $process->Kill();
    }
    else {# process has already terminated}

    Cheers,
    Rob

    --
    To reply by email u have to take out the u in kalinaubears.
     
    Sisyphus, Nov 26, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward Mitchell
    Replies:
    8
    Views:
    1,750
    Steven Cheng[MSFT]
    Feb 22, 2005
  2. Roedy Green

    System.exit(1) never returns

    Roedy Green, Aug 17, 2003, in forum: Java
    Replies:
    5
    Views:
    483
    Dario
    Aug 22, 2003
  3. MikL
    Replies:
    1
    Views:
    6,175
    Gordon Beaton
    Feb 15, 2005
  4. Soren Kuula
    Replies:
    1
    Views:
    461
    Henry S. Thompson
    Dec 1, 2005
  5. Kevin
    Replies:
    4
    Views:
    432
    Irrwahn Grausewitz
    Oct 17, 2003
Loading...

Share This Page