Hi everybody,

I'm writing a web-appish type thing which takes a _long_ time to load
the page while it's processing some data. So I was hoping I could output
a header before running the sub/method which takes a while, to display
some message of the 'loading' variety.
e.g.

print $cgi->header();
$tpl->process('include/header.tpl', \%vars) or die $tpl->error(); 
takes_a_bloody_long_time( $tpl, \%vars );


"takes_a_bloody_long_time" contains several more calls to the process 
method. When I run all this it seems to hang untill it gets to the first

process call in the "takes_a_bloody_long_time" sub and then displays 
the content of both to the browser (and then carries on to the other
process calls).


However if I run:

print $cgi->header();
$tpl->process('include/header.tpl', \%vars) or die $tpl->error(); 
exit; takes_a_bloody_long_time( $tpl, \%vars );

or

print $cgi->header();
$tpl->process('include/header.tpl', \%vars) or die $tpl->error(); 
print STDERR "processed header\n";
takes_a_bloody_long_time( $tpl, \%vars );
 
It runs really quickly and obviously just outputs the header to the
browser or in the second instance print the STDERR output before the
header is sent to the browser.


Does this seem right, has anyone seen anything like this before, got any
ideas?
 
Thanks,

Kristian.

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to