Actually, upon further investigation I found that it is in fact all
subsequent requests the the END block is not called.


You can recreate the anomaly with the following module and script:

Foo.pm:
-------------------------------------------------------------------------------
package Foo;

END{
    warn "END block running";
}

1;
-------------------------------------------------------------------------------

foo.mpl:
-------------------------------------------------------------------------------
#!/usr/bin/perl

use Foo;

print "Content-type: text/html\n\n";
print "Hello World";
-------------------------------------------------------------------------------

Directions:
Start the server in single server mode.
Make a couple requests
Change foo.mpl slightly and save it
Make more requests without restarting the server

You'll see the following in the log file (minus the comments indicating
which request you're on):

# 1st Request:
END block running at /Foo.pm line 4.
# 2nd Request:
END block running at /Foo.pm line 4.
# Change file and save at this point
# 3rd Request and all subsequent requests:
(nothing printed)

Any ideas?

-Chris

On Fri, 12 Jan 2001, Chris D'Annunzio wrote:

> Hello,
> 
> I'm running a script under Apache::Registry which uses a couple of custom
> object-oriented modules. The modules have an END block defined which
> contains some clean-up code that needs to be run every time a request is
> made.
> 
> The usual behavior for Apache::Registry is to explicitly call the
> END block each time the script runs. However, I have found that if I
> modify the main script and then execute a request without restarting the
> server, the END block is not called in that 1st request where the script
> is reloaded.
> 
> After the first request, the behavior returns to normal. Is this a known
> bug or is there some other reason for this behavior? Has anyone else
> encountered this? 
> 
> It's not a huge issue because I normally restart the server after I make
> a change, but it produced some unusual behavior that took a while to track
> down.
> 
> Thanks,
> 
> -Chris
> 
> 


Reply via email to