Hello,
So, when doing a CGI and needing to execute a subprocess with input based
on user input, I always do a open()-fork()-exec() like so:
if(defined(my $pid = open(KID, '-|'))) {
if($pid) {
print while ;
close KID;
} else {
%ENV = ( ... );
exec('/full/path/to/bin', @args);
}
}
When using a mod_perl script, I "use Apache::SubProcess" and the above
stuff still works. However, let's say the subprocess I kicked off takes a
while to process, but prints status information in the meantime (for
example, tagging a big CVS tree, or indexing textfiles, or whatnot). I
want the user to see the information "real-time" (so I'd probably have
local $| = 1 inside the if($pid) block above).
This no longer works under Apache::SubProcess. Tt buffers up all the
output and then sends it all at once. So my parent process reads in an
unbuffered way, but the child "exec()" outputs all at once.
Is there any way to remedy this situation?
Thanks in advance.
Humbly,
Andrew
--
Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED]
Engineer [EMAIL PROTECTED] Voice 650-930-9062
Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101
--