To be more precise fork has a really strange "magic": from that point there will be two processes (or threads) instead of only one - yes, the second process is the forked one.
In the main process the fork will return with the pid of child and in the child process the fork will return with 0. See the man page
here
About the line: die 'Fork Failed' unless defined(my $child=fork());
if fork was not successful (that is $child is not defined) we will die and print a message: Fork Failed
About the line: exit 0 if $child
if $child will be true only if fork was successful and we are now in the parent process. The line means the parent process will be terminated immediately after creating the child.