> Don't mess with the cooker, try using a subclass, e.g.:
> 
> # ModPerl/RegistryPrefork.pm
> 
> package ModPerl::RegistryPrefork;
> 
> use strict;
> use warnings FATAL => 'all';
> 
> our $VERSION = '0.01';
> 
> use base qw(ModPerl::Registry);
> 
> use File::Basename ();
> 
> sub handler : method {
>      my $class = (@_ >= 2) ? shift : __PACKAGE__;
>      my $r = shift;
>      return $class->new($r)->default_handler();
> }
> 
> sub chdir_file {
>      use File::Basename();
>      my $file = @_ == 2 ? $_[1] : $_[0]->{FILENAME};
>      my $dir = File::Basename::dirname($file);
>      chdir $dir or die "Can't chdir to $dir: $!";
> }
> 
> 1;

I copied this into a new file "RegistryPrefork.pm" in the same
directory as the ModPerl Registry.pm in the perl tree, and changed the

   PerlResponseHandler ModPerl::Registry

line in startup.pl to

   PerlResponseHandler ModPerl::RegistryPrefork

and restored the RegistryCooker.pm file to its original contents. I
also removed the Apache::RequestRec::chdir_file definition in my
startup.pl

This seems to work OK. Hopefully I should now be able to remove the
mod_perl 1's Registry.pm file.

Thanks everyone.

Colin


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to