Refresh referring page

[prev] [thread] [next] [Date index for 2005/05/03]

From: Dermot Paikkos
Subject: Refresh referring page
Date: 13:29 on 03 May 2005
Hi,

MP2 RC5, Template,  Image::Magick

I hope this is not off topic, apologises if it is.

I have a perl script written as a handler. It scans a dir for image 
files and offers the user a chance to convert them from tiff to jpeg. 
As there can be lots of files of some size, it can take some time for 
the process to return.

What I wanted was to loop through the files and refresh the page as 
each file was processed. So I had something like;


$r = shift if $ENV{MOD_PERL};
my $tt = Template->new...

foreach my $f (@files) {
	my @files_processed;
	...snip
	push(@files_processed,$f);

	my $vars = {
			files => \@files_processed,
		};
	$r->content_type('text/html');
	$r->headers_out;
	$tt->process($tt_file,$vars)
      	  || die $tt->error;

} # End of foreach

# $r->headers_out;

I thought this would re-send the $vars and headers_out until the list 
was exhausted but in practise what I get was the page repeated for 
each file. EG: if there are 4 files I get 4 <html></html> and a messy 
looking page.

I am not sure what I am doing wrong. If I move the headers_out 
outside the foreach loop I get to the array contents but I still get 
the (size of @files_processed) x <html> tags rather than one nice 
page and I still have to wait for the whole process to complete.

I imagine I am going to have to take another approach but can't thing 
of one. Does anyone now how to refresh a referring page or loop in 
the may I described?

Thanx in advance.
Dp.
 


					

Refresh referring page
Dermot Paikkos 13:29 on 03 May 2005

Re: Refresh referring page
Issac Goldstand 14:11 on 03 May 2005

Re: Refresh referring page
Dermot Paikkos 14:44 on 03 May 2005

Re: Refresh referring page
Issac Goldstand 15:14 on 03 May 2005

Re: Refresh referring page
Ron Savage 00:55 on 04 May 2005

Re: Refresh referring page
Dermot Paikkos 08:25 on 04 May 2005

Re: Refresh referring page
Issac Goldstand 10:31 on 04 May 2005

Re: Refresh referring page
Dermot Paikkos 10:44 on 04 May 2005

Re: Refresh referring page
Dermot Paikkos 15:07 on 04 May 2005

Generated at 11:50 on 06 May 2005 by mariachi v0.52