H
hendedav
Gang,
I am using a cgi to call a pl script and then pass xml back to
the web browser (code listed below). The problem I am having is that
the code in the cgi executes promptly and as it should, but the return
values, for some reason, don't get sent to the browser until the pl
script is completed. Currently the pl script accepts two parameters
(but does nothing with the first one currently) and just uses a while
loop that counts to the 2nd passed value. If anyone can help with
this (or knows a better way to get the pid, please let me know.
Dave
$_ = param('runnow'); # passed variable value
if (system("./backup.pl \"$_\" 30 \&") == 0) {
$_ = `ps aux|grep "backup.pl $_" 2>&1`; # finds the pid of the
pl
my ($pid) = /(\d{3,})/; # isolates the pid only
chomp($pid);
my @info = stat("/tmp/buj$pid"); # this file is created by the pl
script
print "Content-type: text/xml\n\n\n";
print "<info pid=\"". $pid ."\" date=\"". scalar(localtime) ."\" /
I am using a cgi to call a pl script and then pass xml back to
the web browser (code listed below). The problem I am having is that
the code in the cgi executes promptly and as it should, but the return
values, for some reason, don't get sent to the browser until the pl
script is completed. Currently the pl script accepts two parameters
(but does nothing with the first one currently) and just uses a while
loop that counts to the 2nd passed value. If anyone can help with
this (or knows a better way to get the pid, please let me know.
Dave
$_ = param('runnow'); # passed variable value
if (system("./backup.pl \"$_\" 30 \&") == 0) {
$_ = `ps aux|grep "backup.pl $_" 2>&1`; # finds the pid of the
pl
my ($pid) = /(\d{3,})/; # isolates the pid only
chomp($pid);
my @info = stat("/tmp/buj$pid"); # this file is created by the pl
script
print "Content-type: text/xml\n\n\n";
print "<info pid=\"". $pid ."\" date=\"". scalar(localtime) ."\" /
}