Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
You may see script with no sense, it’s just an exercise.sub testfork { if (($pid = fork) == 0) { exec("date +'%Y-%m-%d %H:%M:%S' >date.tmp"); } elsif ($pid > 0) { #Parent wait; open (DA, "date.tmp"); $da=<DA>; close (DA); unlink ("date.tmp") or die "Cannot unlink date.tmp ($!)" ; print "the date returned from the child process is: $da\n"; } else { print ("Could not fork: errno is $!\n"); } }
2003-06-07 edit ybiC: Retitle from "A quick question"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Runs from console but not as CGI - temp file not created
by sauoq (Abbot) on Jun 08, 2003 at 04:01 UTC | |
|
Re: Runs from console but not as CGI - temp file not created
by The Mad Hatter (Priest) on Jun 08, 2003 at 03:36 UTC | |
|
Re: Runs from console but not as CGI - temp file not created
by dws (Chancellor) on Jun 08, 2003 at 05:25 UTC | |
|
Re: Runs from console but not as CGI - temp file not created
by Anonymous Monk on Jun 08, 2003 at 06:05 UTC | |
|
Re: Runs from console but not as CGI - temp file not created
by vek (Prior) on Jun 08, 2003 at 16:42 UTC |