From: ccc31807 on
On Win32, the process id is whatever the value of $$ is.

When you fork(), the parent retains whatever the original pid was.
However, the child pid has a negative number. Why?

CODE
my $orig_pid = $$;
my $child = fork();
if ($$ > 0)
{
print qq(1. The pid is $$\n);
print qq(Parent process pid is $$, child is $child\n);
}
else
{
print qq(2. The pid is $$\n);
print qq(Child process pid is $$, parent is $orig_pid\n);
}

OUTPUT
1. The pid is 3172
Parent process pid is 3172, child is -2272
2. The pid is -2272
Child process pid is -2272, parent is 3172
From: Charlton Wilbur on
>>>>> "cc" == ccc31807 <cartercc(a)gmail.com> writes:

cc> On Win32, the process id is whatever the value of $$ is. When
cc> you fork(), the parent retains whatever the original pid was.
cc> However, the child pid has a negative number. Why?

Win32 is not Unix. perldoc perlfork

Charlton

--
Charlton Wilbur
cwilbur(a)chromatico.net