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 }, ....
}

> I want and changes to contect to only be applicable to the current 
> request...

Don't make closures then.  Pass the value to the sub.

- Perrin

Reply via email to