From: "Thilo Planz" <[EMAIL PROTECTED]>
>
> something like this on top of teardown
>
> local $| = 1;
> print;
That seems to work! The "local $| = 1" causes the page to be displayed by
the browser immediately while "sleep(5)" executes. (The print doesn't seem
to affect it either way.) The browser spins during that 5 seconds. But the
page appeared at the very start. If I really had a 5 second process running
I might want to fork a child so the browser wouldn't spin. But, if I'm only
trying to eliminate <1second page delay (the illusion of completion), your
suggestion should be perfect.
If this process runs under mod_perl, will the "$|" value persist? Do I need
to change the value back? "Local" takes care of this for me, right?
One thing that made me leery of forking a "teardown" process is that it
appears my DBI connection (and prepared statements too?) won't survive. The
parent or the child will get messed up sharing the connection. I would have
to reconnect in the child. Not too bad if I really had some major processing
to do. But, just to avoid a little bit of post-processing it seemed wrong.
> But why don't you put your subroutines into proper Perl modules?
> Not all that difficult to set up and has many benefits (such as not
> having to worry about what mod_perl does with it).
I may do that. I have difficulty comprehending Perl's modules and objects.
A related question. In my packages (which are based on cgi::application), I
declare and initialize "our" variables at the top. They are visible to
everything in the file. (I pass them by reference to subroutines in the .pl
library.) That makes them class data (not accesible as object data)? If I
wanted to make them accessible to subroutines, would I set them up in
cgiapp_init as "$self->{var1}"? If this is correct, won't mod_perl execute
cgiapp_init multiple times? My variables will be re-initialized when that
may not be what I want?
Thanks,
Mark
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]