""Ibrahim Dawud"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Since mod_perl wraps my entire code into a handler subroutine behind
> the scenes, I figured out how to access the apache API from a normal
> cgi script. Hence, the following example appears to be working under
> mod_perl2:
>

<snip />

>
> With my more complicated example (listed below), I get mixed results.
> Sometimes it works, sometimes I get segmentation faults, and sometimes
> I get the following error in my Apache error_log which I don't
> understand:
>
> "$r->rflush can't be called before the response phase at
> /html/perl/test.pl line 107"
>
> The complete code is as follows:

<snip />

> sub newstatus {
>    my ($s) = @_;
>
> print <<"EOT" ;
> <script language="JavaScript1.2"><!--
> newstatus("$s");
> //--></script>
> EOT
>
> $r->rflush;
>
> }
>

Ick. It looks to me like this should work. Since the only thing you are 
using the Apache request object for is to flush the buffer, you might want 
to try Apache->request->rflush instead of holding a reference to the object. 
Though if what you have is breaking, it probably won't work.

I suggest taking this to the mod_perl mailing list, I'm sure they would want 
to know about it.

Make sure you give them system and environment info...

Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to