Re: cleaning up as application ends

[email protected] ("Mumia W.")
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
On 05/12/2007 05:37 PM, Mary Anderson wrote:
>  I would like to perform some clean up at various points in my application.
>  Here is one of them.
> 
>  if ($pageName eq 'CSV'){
> 	my $made_and_stuffed = make_and_stuff_query($pageName);
>         if ($made_and_stuffed == 1){
> 		my $pathName = execute_CSV_query($pageName);
> 		print a({-href=>$pathName}, 'Open  CSV File'), hr;
> 	}
>  }
>  On returning from viewing the file, or on hitting the submit button to go
> to the next page, or on exiting the application I would like to get rid of
> this file (using unlink, of course)  Perl's  END should do the trick, but I
> find that it has rather odd notions of just what constitutes the END of the
> application.  
> Although this particular file can be unlinked anytime after it has been
> opened, I do have some clean up jobs which can be performed only when the
> application exits.  END, which has been tried, really does not work for this!
> 
> Thanks,
> Mary Anderson
> 

END blocks should work properly unless you're running under mod_perl. If 
you using a mod_perl environment, then special considerations must be made:

http://perl.apache.org/docs/1.0/guide/porting.html#END_blocks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.