You should check whether fork actually worked. When it fails, it returns undef, and your script will think it succeeded, and that it is the child. The perlipc page has an example I'm paraphrasing:
if ( my $pid = fork() ) { # parent } else { die "Can't fork: $!" if ( ! defined $pid ); # child }
In reply to Re: Debugging forking scripts in screen
by kyle
in thread Debugging forking scripts in screen
by harleypig
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |