On Wed, Jun 30, 2010 at 16:37, Tim Bunce <tim.bu...@pobox.com> wrote: > On Wed, Jun 30, 2010 at 09:24:42AM -0600, Alex Hunsaker wrote: >> On Wed, Jun 30, 2010 at 02:49, Tim Bunce <tim.bu...@pobox.com> wrote: >> > I suggest the code shift items off the main array, like perl does, >> > but also push those items onto a new temp array.
> I presume mod_perl doesn't shift the array because it wants the array to > persist to be used again later. Yeah... Basically when running under ModPerl::Registry it tries to treat your script exactly like it is running under cgi. So when the script finish it runs end blocks. When the next request comes in you still want those end blocks to run. >From the ModPerl::Registry documentation: | END blocks encountered during compilation of a script, are called | after the script has completed its run, including subsequent | invocations when the script is cached in memory. This is | assuming that the script itself doesn't define a package on its | own. If the script defines its own package, the END blocks in the | scope of that package will be executed at the end of the interpretor's life. > Otherwise running 11 the first and 21 the second is the right behavior > for this (very unusual) test case. Yeah... I think you are right, I was completely over thinking things I think.