in reply to Continuing a program after Forking

fork() returns the child pid in the parent, and 0 in the child, therefore you should:
unless($child=fork()){ #in child code... .. .. exit} #out...