in reply to launch and then exit out of app
Check this out AM:
For doing spawning and dying parents I much prefer the mehodology of using an exec instead of system. Evaluating $! will give you the reason you couldn't spawn the exec'ed process.my $child=fork(); # Spawn off a child if ($child>0) { #parent exec ($app1) || die "Could not exec $app1:$!"; exit(0); # Should never get here! } elsif ($child == 0 ) { # Child process exec ($app2) || die "Could not exec $app2:$!"; exit(0); # should never get here either } else { die "Could not fork! $!"; }
As always in Perl TIMTOWTDI and YMMV. One thing you didn't specify is what platform you are attempting this feat of derring do...
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: launch and then exit out of app
by Anonymous Monk on Feb 03, 2004 at 19:24 UTC | |
by blue_cowdawg (Monsignor) on Feb 03, 2004 at 19:32 UTC | |
by flyingmoose (Priest) on Feb 03, 2004 at 19:51 UTC | |
by eyepopslikeamosquito (Archbishop) on Feb 04, 2004 at 01:52 UTC |