Perrin Harkins wrote:
On Fri, 2005-08-19 at 20:55 -0400, Christopher H. Laco wrote:

So, changing to

package MyMod;

   my @context;
   sub dosomething {
     push @context;
     #...do other stuff..
   };
   sub pushcontext {
     push @context, shift;
   };

1;


Woudld fix the persistance issue?


No.  If you want to call dosomething without making @context persist,
you need to do it like this:

my @context;
dosomething([EMAIL PROTECTED]);

sub dosomething {
    my $context_ref = shift;
    push @{ $context_ref }, ....
}


Huh? Now I'm really confused. MyMod2 calls MyMod1::dosomething alters it's own @context (it should've been push @context, 'foo')...

MyMod2 calls MyMod1::pushcontext('anotherfoo') to also alter MyMod1s @context. Why would each modules @context persist since they're declare as my and their our of closure?

Even if they did, that's a moot point as I can resent them during every page request (via AxKits start_document function).

What I'm more worried about is that I just want those MyMod1 and MyMod2 @context changes to be effecting the current request only, not other requests in other apache child processes.

-=Chris

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to