On Friday, April 26, 2002, at 10:01 , Alex Read wrote:
[..]
> #!/usr/bin/perl
> use strict;
>
> defined(my $pid = fork ) or die "Could not fork: $!";
> if ($pid){
> print "Content-type: text/html\n\n";
> print "\nHI1\n\n\n\n";
> exit;
> } else {
>close(STDIN);
>close(STDOUT);
>close(S
> -Original Message-
> From: Alex Read [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 1:01 PM
> To: Bob Showalter
> Cc: [EMAIL PROTECTED]
> Subject: Re: Probably a stupid question
>
>
> Thanks guys,
>
> I think this should be able to do
Thanks guys,
I think this should be able to do what I want, as the browser goes
straight to the return page and prints 'HI1'.
Thanks again,
Alex
#!/usr/bin/perl
use strict;
defined(my $pid = fork ) or die "Could not fork: $!";
if ($pid){
print "Content-type: text/html\n\n";
print "\nHI1\n\n\
> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 12:45 PM
> To: 'Alex Read'; [EMAIL PROTECTED]
> Subject: RE: Probably a stupid question
>
> ...
>
> The way to code this to do something like:
&
On Friday, April 26, 2002, at 09:40 , Alex Read wrote:
> Hello,
>
> OK, we now have the following;
>
> #!/usr/bin/perl
> use strict;
>
> my $pid = fork;
> if ($pid == 0){
> exec 'sleep 2; echo "hi"' || die "Cannot sleep: $!" ;
> } else {
> print "Content-type: text/html\n\n";
> print "\nhi\n\n\
> -Original Message-
> From: Alex Read [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 12:01 PM
> To: [EMAIL PROTECTED]
> Subject: Probably a stupid question
>
>
> Hello,
>
> OK, I have a nice a simple test case, but I just can't get it
> to do what
> I want it to. How do I
Hello,
OK, we now have the following;
#!/usr/bin/perl
use strict;
my $pid = fork;
if ($pid == 0){
exec 'sleep 2; echo "hi"' || die "Cannot sleep: $!" ;
} else {
print "Content-type: text/html\n\n";
print "\nhi\n\n\n\n";
}
So the child process is the only one that sleeps for 2, then prints hi,
On Friday, April 26, 2002, at 09:01 , Alex Read wrote:
> Hello,
>
> OK, I have a nice a simple test case, but I just can't get it to do what
> I want it to.
[..]
>
> Alex.
>
>
> #!/usr/bin/perl
> use strict;
>
> my $pid = fork && exit; #$pid should return 0 if fork is
> successful.
>
> if (