xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
I realized that my OS is win and value of $child is negative. So I change if ($child>0) to if ($child != 0),but error message is still there!perlfunc and Supper research don't give me any useful clue.#!/usr/bin/perl use strict; use warnings; print "pid=$$\n"; my $child= fork(); die "Can't fork: $!" unless defined $child; if ($child > 0) { #parent process print "Parent process:Pid=$$,parentid=$child\n"; } else { # child process my $ppid = getppid(); # 14 line print "Child process: PID=$$,parent=$ppid\n"; } __OUTPUT__ pid=1588 The getppid function is unimplemented at fork_test.pl line 14. The getppid function is unimplemented at fork_test.pl line 14.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getppid is broken in Win?
by quester (Vicar) on Jan 18, 2007 at 08:43 UTC | |
|
Re: getppid is broken in Win?
by BrowserUk (Patriarch) on Jan 18, 2007 at 13:45 UTC | |
|
Re: getppid is broken in Win?
by xiaoyafeng (Deacon) on Jan 19, 2007 at 03:13 UTC |