[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
How do I start a process in the background?
Hello Every Body!
Maybe somebody help me.
I've a form in html,the submit call a perl-cgi(program.cgi) and this
program contain
a line to invoke a other programm in background:
===========================================
program.cgi
#!/usr/bin/perl
print STDOUT "Content-type: text/html \n\n";
$| = 1;
select(STDOUT);
&parse_form;
&get_variables;
print STDOUT "<html><body>Congratulations your form
............</body></html>";
system("./senddata.pl $wcod_grp '$wmail' &");
#or ´./senddata.pl $wcod_grp '$wmail' & `
#or exec("./senddata.pl $wcod_grp '$wmail' & ");
#or 
#FORK: {
#   if ( $pid = fork ) {
#       print STDOUT "<html><body>Hola</body></html>";
#   } 
#    elsif ( defined $pid ) {
#       exec("nohup ./sendata.pl $wcod_grp '$wmail' &");
#    } 
#}
sub parse_form
{
}
sub get_variables
{
}
===================================================
The program senddata.pl execute all code in about 30-40 seconds (this
programm dont write anythig
in stdout), but i don't want the people wait all this time to look the
message "Congratulations your form ............" for this i started a
programm in background but don't work.
I found a solution to display the message before the programm in
background finish, i 
writed this lines in "program.cgi" 
        $| = 1;
        select(STDOUT);
the browser show the message "Congratula....." but the hourglass
continue working i when
i click on buttoms Back-Forward-etc show the message "Transfer
Interrupted"
any idea?
Thanks, regards
Liliana
- Follow-Ups from:
 - 
Dominic Dunlop <domo@computer.org>
 
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]