[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-modperl
Subject: Re: perl END{} equiv for Apache::Registry?
From: Stas Bekman <sbekman () iil ! intel ! com>
Date: 1999-06-30 17:08:01
[Download RAW message or body]
> Under mod_perl and Apache::Registry, is there anything that mimics the
> plain perl (as opposed to mod_perl) behavior of BEGIN{} and END{}?
http://perl.apache.org/guide/porting.html#BEGIN_blocks
http://perl.apache.org/guide/porting.html#END_blocks
>
> For example, can anything be added (or changed) in my_module.pm (below) to
> destroy $my_module::my_global without adding anything in my_script.cgi
> (also below).
>
> Alternatively, is there anything in the request object ($r) or elsewhere
> which is unique for every pass (i.e. for every call to my_script.cgi)? or
> is it possible for a script to add to $r?
>
> ------v- my_script.cgi -v------
>
> use my_module;
>
> {
> my $ptr1 = my_module->new(); # I want a different ptr than last time
> $ptr1->do_stuff(); # my_script.cgi was run...
> }
> {
> my $ptr2 = my_module->new(); # ...but I want $ptr1==$ptr2
> $ptr2->do_more_stuff();
> }
>
> ------^- my_script.cgi -^------
> ------v- my_module.pm -v------
>
> package my_module;
>
> $my_global = undef();
>
> sub new {
> return $my_global if ($my_global);
> ($my_global = bless({}, $_[0]))->_init(); # Not relevant
> return $my_global;
> }
>
> sub _init { ... } # Not relevant
> sub do_stuff { ... } # Not relevant
> sub do_more_stuff { ... } # Not relevant
>
> ------^- my_module.pm -^------
>
> I've searched for an answer with no success, so thanks for any
> assistance.
>
> ELB
>
> --
> Eric L. Brine | Chicken: The eggs's way of making more eggs.
> q2ir@unb.ca | Do you always hit the nail on the thumb?
> ELB@iname.com | An optimist thinks thorn bushes have roses.
>
>
_______________________________________________________________________
Stas Bekman mailto:sbekman@iil.intel.com www.singlesheaven.com/stas
Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC
www.apache.org & www.perl.com == www.modperl.com || perl.apache.org
single o-> + single o-+ = singlesheaven http://www.singlesheaven.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic