in reply to launch and then exit out of app

I have used Proc::Background a few times and it is much more readable than fork and exec. Plus, it works on Windows too -- fork tends not to work well there.

use Proc::Background; my $proc; my @commands=($cmd1,$cmd2); foreach my $foo (@commands) { $proc = Proc::Background->new($foo); }

(I have updated the code above to remove the wait call, note: Proc::Background has some very good features if you want to wait on a process or check whether processes are still running...those features are not required here)

Replies are listed 'Best First'.
Re: Re: launch and then exit out of app
by gmpassos (Priest) on Feb 03, 2004 at 19:34 UTC
    Good tip. Note that fork (the OS resource) doesn't exists on Win32. Soo, the fork() function on Win32 just create a new thread, what doesn't change the proccess ID, what shows to us that the approach of fork() on Win32 does nothing.

    Graciliano M. P.
    "Creativity is the expression of the liberty".