#!/usr/bin/perl
# Test that the Perl fork() function behaves as expected.

my $pid;
if ($pid = fork)
{
    # parent here
    # child process pid is available in $pid
    exit 0;
}
elsif (defined $pid)
{
    # $pid is zero here if defined
    # child here
    # parent process pid is available with getppid
    exit 0;
}
else
{
    # weird fork error
    exit 1;
}
