in reply to Fork Problem

Define "isn't working". Do you get an error message? What do you expect your script to do that it isn't doing? What is it doing instead?

Off-hand, your script is forking and staying forked. Your system call will return when the command is completed, and then continue execution of your script just as if it were the parent (at least until the parent kills it). Have you verified that the script will successfully do a system call with that argument without problems?

I'm also tempted to ask you what you're trying to do here. Is your sleep/kill combo an attempt at enforcing a timeout? Consider alarm in the child process for that. Either way, you're going to be a lot better off putting an exit after your system call, or use exec instead of system (checking to be sure exec doesn't return in an error).

If this doesn't help you, we need more information.

Replies are listed 'Best First'.
Re: Re: Fork Problem
by Anonymous Monk on Dec 08, 2000 at 02:29 UTC
    I'm launching a Windows based program with this script.

    exec('C:\Progra~1\Blah\Blah');

    It works; it runs the program fine. This program is not command line, so it opens in its own window. I then need to run another program after the first one has launched.

      I'm launching a Windows based program with this script.
      That's your problem, then. Windows does not allow you to fork. You'll need to simulate fork, but I wouldn't guarantee the results. Assuming you're running ActivePerl, you can read about this here.

      Cheers,
      Ovid

      Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

        More importantly WINDOWS does not support signals so I guess kill is not going to work.
        --

        Zigster