[htmltmpl] Executing code after print $template->output
Brought to you by:
samtregar
From: John <jo...@e-...> - 2004-05-10 15:38:46
|
Hi everyone BACKGROUND I'm using H::T with mod_perl and want to run some slow (several seconds) of code at the end of a script, and after the user receives his HTTP response. I have tried doing the following: print $template->output; $r->register_cleanup(\&some_stuff); sub some_stuff() { sleep 10; #for example } Expecting to receive the template page while the sub routine "some_stuff" does its thing. However, H:T seems to wait till "some_stuff" finishes before going to work. AND NOW THE QUESTION(S) So is there any way of getting H::T to get to work before the script calling the ->output method finishes ? What exactly does H::T wait for before swapping the tags anyway ? An alternative (and maybe off topic) question would be, if H::T must wait till the script calling the output method finishes before executing, does anyone know of a way to get the results I am looking for without forking ? Cheers John --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.680 / Virus Database: 442 - Release Date: 09/05/2004 |