in reply to Test::Cmd and forking
I ran into a similar problem myself in my own test code where I didn't want some END blocks to get executed in the child. There are several possibilities to avoid cleanup code when a forked child exits. I thought of a couple (I bet there's more than two ways to do this though). I'm not really satisfied with either of these though.
- Rather than exit or die in the child, exec something innocuous, e.g.:
exec('/bin/true') or exec('perl','-e','')
- Another possibility which I thought of but did not test is to have the child send itself a SIGKILL (or maybe a SIGTERM) would be enough?)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Test::Cmd and forking
by fergal (Chaplain) on Jul 13, 2004 at 21:45 UTC |
In Section
Seekers of Perl Wisdom