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. | |
In reply to Re: launch and then exit out of app
by blue_cowdawg
in thread launch and then exit out of app
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |