Now, I have a CGI script which using GET method to receive Query, 
and my script looking like this :

########################################
# C:/PERL/BIN/PERL.EXE
# script name : QUERY.PL

require "my_external_scripts.pl";

$query = $ENV{QUERY_STRING};
$result = time."_".$ENV{REMOTE_ADDR}.$myPackage::random(99999);

&call_query_string_handler($query, $result);
while (! -e $result) { 1 } 

open (FILE, $result) ; 
while (<FILE>) { print $_ }  
close (FILE);
unlink($result)
########################################

In case, I am trying to enforcing the script unable to terminate
until the result file comes. And the result file will be built when
all the child process are done.

my questions are :

1. When 2 or more users are querying the same script with the same query
at the same time, would the script handle it with 'another colsole'? or 
involving to wait until the first in query has done ? How about the child subs?

2. Is it a bad programming style ?  Straight line running, Sub scripts are working 
as self operating.  Main will call A, A will call B, B will call C, C will call D, and 
D 
gen the result,  no value will return to 'the caller'.  I can imagine that might quite 
a problem for tracing errors, so I designed each sub script will log down their 
activities on common log file with, A,B,C and D. Would it be better ?

Any comment and/or hints are very apperciate. At lease, please tell me
how to test it by myself ^_^"

Thanx alot,
Connie

Reply via email to