Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello!

I am looking for some help with Apache::RegistryLoader. I am trying to preload some of my scripts but when I try to install Apache::RegistryLoader it starts an infinite loop, or stalls. Something not right is happening. I would really like to see if I can save some more memory by doing this.

Anyone have any advice?

Thanks!

Replies are listed 'Best First'.
Re: Help with Apache::RegistryLoader
by jbrugger (Parson) on Jul 07, 2005 at 04:31 UTC
    We can't just help you based on this information.
    You should at least give the following information.
    - What server are you on (windows / linux / bsd)
    - How is apache compiled (did you install a binary package?)
    - What are the specs of the server
    - Versions of your software
    etc.etc.

    Then you might get possible ideas to search for:
    - Did you try each script separately?
    - Are you referencing scripts to eachother, and are there circular references?
    - Do you use strict and warnings
    - Do the scripts work properly without preloading?


    Please send an example of a script that doesn't preload.

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
      My problem is that I can not get apache::registryloader to install at all.. It hangs during install. My scripts work fine and is on a linux machine.
        You still don't give enough information about the problem, but if you can't get it to work, lets try a work-around:
        Why don't you try to use a 'startup.pl' script to compile your modules in the first apache server?
        example for apache2:
        # in /etc/apache2/mods-enabled/perl.conf: PerlModule Apache2 PerlModule ModPerl::Registry PerlInitHandler Apache::Reload PerlRequire /etc/apache2/startup.pl # in /etc/apache2/startup.pl use lib qw(/var/www/cgi-bin /var/www/cgi-bin/modules); use DBI; use CGI qw(:cgi); use File::Find; use HTML::Template; use OwnModulesHere; print STDERR "Pre-loading HTML Templates...\n"; if (1) { find( sub { return unless /\.tmpl$/; HTML::Template->new( filename => "$File::Find::dir/$_", cache => 1, ); }, '/var/www/TemplatesFolder', ); }
        "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
        Did you install mod_perl? If so, you already have Apache::RegistryLoader. It comes with mod_perl.
        Define "Install".

        Do you mean the initial install (from CPAN presumably) or the "working" install done by running Apache2?

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law