in reply to Re: Forking problems
in thread Forking problems

The and $pid == 0 in your updated solution is redundant. It will always be true.