Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Help with Apache::RegistryLoader

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


tmornini at infomania

Feb 16, 2000, 9:12 PM

Post #1 of 1 (765 views)
Permalink
Help with Apache::RegistryLoader

I'm going insane! In my startup.mpl file I have this code:

use File::Find;
use Apache::RegistryLoader();

initialize_scripts('/usr/local/apache-common/htdocs/');

sub initialize_scripts {

my @roots=@_;
my $num=0;

for my $root (@roots) {

warn "Initializing scripts under $root";

find(
sub {
return unless /^.+\.(mtpl$|mpl$|cgi$)/; # is this a script

my $path="$File::Find::dir/$_";
return if $path=~m|/CVS/|; # is this a CVS file?

my ($uri)=$path=~/\Q$root\E(.+)/; # capture URI portion

$num++;

warn "Initializing $num: $uri with $path";

Apache::RegistryLoader->new->handler($uri,$path);
},
$root
);
}
}

This is what is making me insane: Run as-is the warn shows 10 scripts
pre-compiled, and perl-status agrees. The problem is that this is not all
of the scripts that exist within that directory tree, though it is all of
them in the highest level (I know this is somehow the problem, but I
can't quite grasp it...). If I comment out the call to
Apache::RegistryLoader then the warn shows 68 scripts, which is correct.
The other 58 are all in sub-directories of htdocs...

I've checked the $uri and $path being passed in and everything seems
correct.

How could a call to Apache::RegistryLoader alter the function of the
File::Find function? File::Find docs specifically mention not to alter $_
and I have tried local'ing it and personally saving and restoring it
myself, but to no avail.

Has anyone been here before?

--
-- Tom Mornini
-- InfoMania Printing and Prepress

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.