Sometimes I think too hard about this I swear. :-)

Just a mini backgrounder...I have two AxKit Taglibs that run under AxKit/mod_perl. Up till now, they've been seperate in terms of usage. I now need to have one modify a value of the other. This has brought me to wonder if what I've done is going to cause me grief.

Here's one of the modules:
http://search.cpan.org/src/CLACO/Handel-0.17_08/lib/AxKit/XSP/Handel/Cart.pm

In a nutshell, it's basically:

package MyMod;
{
  my @context;
  sub dosomething {
    push @context;
    #...do other stuff..
  };
};
1;


I'm assuming that each tome dosomething() changes @contect, it's only changing @contect for that MP child process. SInce I don't do a lot of MP development, I haven't live through all of the traps involved yet. :-)


Now, I need to have another module used in that same request, modify the context of the first...

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

package MyMod2;
{
  my @context;
  sub dosomething {
    push @context;
    #...do other stuff..
    MyMod::poshcontext('foo');
  };
};
1;

Is that safe across requests? I'm assuming that MyMod is change MyMod2 in the same request/child process? FOr that matter, what is the lifetime of my @context in that situation?

Thanks for suffering though this...
-=Chris

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

Reply via email to