Re: END ing in a cgi script

[email protected] ("Mumia W.")
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
On 02/17/2007 06:46 PM, Mary Anderson wrote:
>> The documentation wasn't very clear.
> Under mod_perl, the above will work only for Apache::Registry scripts. 
> Otherwise execution of the END block will be postponed until the process 
> terminates. If you write a handler in the Perl API use the register_cleanup
> () method instead. It accepts a reference to a subroutine as an argument:
> 
>   $r->register_cleanup(sub { $dbh->sync() });
> 
> I don't know what $r refers to.  Can you enlighten me?
> 
> Thanks again.
> Mary
> 
> 

(Re-directed back to the list.)

I don't know what $r is. Perhaps it's set this way:

my $r = Apache->request;

Or maybe it's set this way:

my $r = shift;

However, neither of those work for me when I try to send the 
'register_cleanup' message to $r.

http://perl.apache.org/docs/1.0/guide/debug.html#Safe_Resource_Locking_and_Cleanup_Code
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.