Hello Michael, thank you very much for your help. The Script now works as wished. By the way, I've looked at the perlfork, too and I read at Activestates' Homepage that the fork() command works since ActivePerl 5.6.1 which I am using. So please don't mind, perhaps I missunderstood the facts I've read ( english is not my first language ).
Thank you once again Sascha > -----Urspr�ngliche Nachricht----- > Von: Michael Higgins [SMTP:[EMAIL PROTECTED] > Gesendet am: Donnerstag, 5. Juni 2003 18:26 > An: [EMAIL PROTECTED] > Betreff: Re: AW: How to run a long time cgi-program > > Teifke Sascha ZFF FW-P2E wrote: > > I found the script below and tried, but Using Apache for Win32 and IE > 5.5 as > > a client > > the client still waits for the child process to finish until it prints > the > > desired output and > > brake the connection to the server. > > > > Any Ideas? > > Sascha -- > > Combing through perldoc perlfork: > > " > On some platforms such as Windows where the fork() system call is not > available, Perl can be built to emulate fork() at the interpreter level. > While the emulation is designed to be as compatible as possible with the > real fork() at the level of the Perl program, there are certain > important differences that stem from the fact that all the pseudo child > "processes" created this way live in the same real process as far as the > operating system is concerned. > " > > and > > " > On some platforms such as Windows where the fork() system call is not > available, Perl can be built to emulate fork() at the interpreter level. > While the emulation is designed to be as compatible as possible with the > real fork() at the level of the Perl program, there are certain > important differences that stem from the fact that all the pseudo child > "processes" created this way live in the same real process as far as the > operating system is concerned. > " > > and finally: > > " > BUGS > [...] the fork() emulation is not recommended for use in production > applications at this time. > " > > So, I ran it on my linux box. Works just like you'd want it to. > > To do it on windoze, maybe this'll work: > > ------------------------------------------ > script 1: > > #!C:\Perl\bin\perl.exe > > my $path = '"C:/Program Files/Apache Group/Apache/htdocs/test"/'; > my $url = "http://localhost/test/"; > my $mask = sprintf("%06d",rand (10000)); > my @argz = (" \"C:\\Program Files\\Apache > Group\\Apache\\cgi-bin\\child.pl\" $path $mask"); > > # this ist the branch for the parent > print "Content-type: text/html\n\n"; > print "<html><body>"; > print "Your request has been received<br>"; > print "and is beeing processed. $result<br>"; > print "You can access the results at "; > print "<a href=\"" . $url . "A" . $mask . ".html\">A" . $mask > .".html</a> "; > print "once completed."; > print "</body></html>"; > > exec ('C:\Perl\bin\perl.exe', @argz); > exit; # terminate the parent process > --------------------------------------------------------------- > script 2 child.pl > > #!C:\Perl\bin\perl.exe > # this is the branch for the child process > > open STDIN, "/dev/null"; > open STDOUT, "/dev/null"; > open STDERR, "/dev/null"; > > sleep ( 5 ); > > $path = shift; $mask = shift; > $filename = $path . "A" . $mask . ".html"; > print $filename; > open ( OFD , "> $filename " ) or die "Unable to open: $!"; > > # open the file to write the results to > print OFD "<HTML><BODY>"; > print OFD "The results of your query are 4 and 12."; > print OFD "</BODY><HTML>"; > close ( OFD ); > > exit; # terminate the child process > > ----------------------------------------------- > > -- michael higgins > > > _______________________________________________ > Perl-Win32-Admin mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
