in reply to using defined on fork

The return values of fork are listed in the documentation for fork. Fork can return three values - 0 for the parent, nonzero for the child and undef if the fork fails.

So, the defined check is there to check if the fork was successful.