Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Apache::Registry - shared variable?

by tqisjim (Beadle)
on Jun 20, 2013 at 17:04 UTC ( #1040003=note: print w/ replies, xml ) Need Help??


in reply to Apache::Registry - shared variable?

Apache::Registry as in mod_perl 1.3? I believe Apache::Registry was deprecated a long time ago.

I wrote a patch for Apache::Registry many years ago that fixes a vexing oversight: When a module is imported, the END {} block is executed right away. This problem usually affects database handles.

That patch, Apache::ChildExit, is still on CPAN. I don't have much time to consider your question. But I generally post this answer when I see problems with Apache::Registry.


Comment on Re: Apache::Registry - shared variable?
Re^2: Apache::Registry - shared variable?
by tqisjim (Beadle) on Jun 20, 2013 at 17:16 UTC

    Also, one of Apache::Registry's shortcomings was a confusing and somewhat incomplete approach to sharing variables among sessions. Since the code is cached, the variables aren't automatically re-initialized each time the script is run. This might solve your problem:

    my $foo ; ## usually ok in perl my $foo = undef ; ## an Apache::Registry requirement?

    If you're not committed to Apache::Registry. Consider an alternative. Also, the mod_perl mailing list: http://perl.apache.org

      Oh, and to answer your other question...
      $VAR1 = { 'MOD_PERL_API_VERSION' => 2, 'MOD_PERL' => 'mod_perl/2.0.4' };

      In Apache config, though:

      PerlResponseHandler ModPerl::Registry

      Our code is "not mod_perl safe", so we were told to use Registry to work around that.

        Our code is "not mod_perl safe", so we were told to use Registry to work around that.

        Yup, Registry is used to run .cgi's under mod_perl but isn't a cure-all, it won't magically make sure you're using CGI.pm correctly or that you're Coping with Scoping -- see (this which you probably already saw) for some issue CGI to mod_perl Porting. mod_perl Coding guidelines and tweak your code

Re^2: Apache::Registry - shared variable?
by DaisyLou (Acolyte) on Jun 20, 2013 at 20:30 UTC
    Thanks! Is there any risk of messing up existing scripts if I install this? Test cycles around here take ages.
Re^2: Apache::Registry - shared variable?
by Anonymous Monk on Jun 21, 2013 at 07:37 UTC

    That patch, Apache::ChildExit, is still on CPAN. I don't have much time to consider your question. But I generally post this answer when I see problems with Apache::Registry.

    How would this cause data duplication or stale data or data from previous session/request leaking through to a new one? Cause it wouldn't you know, its pretty much guaranteed to have nothing to do with it

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040003]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2014-09-19 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (142 votes), past polls