in reply to Debugging forking scripts in screen

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 }

Replies are listed 'Best First'.
Re^2: Debugging forking scripts in screen
by harleypig (Monk) on Feb 09, 2007 at 06:00 UTC

    Thanks. I know about that ... the second code block was what I used to check the get_fork_TTY subroutine. It's not the script that I'm debugging.

    Harley J Pig