On 8/17/07, Manoj Bist <[EMAIL PROTECTED]> wrote: > I have a perl binding for a C library which generates binary(audio/video) > data. To push this binary data over an HTTP response, fprintf(stdout,...) > does not work in context of modperl. > Do I have to copy the binary data to a perl scalar variable and then do > $r->print(...) in the perl script?
This is a little outside of my Apache internals knowledge, but the way this used to work is that mod_perl would make STDOUT run through $r->print when you print something from Perl. (The mechanism for this changed over the years and I've lost track of how it works in mod_perl 2.) Your C library will not get that, and will probably need to print things the same way that an Apache module in C would. I imagine you could pass it the needed Apache structures from perl, or you could do as you mentioned and have it send the data back in a form that you can read in perl. - Perrin