At 12:59 4/25/00 -0600, Martin Lichtin wrote:
>Doug MacEachern wrote:
>> > Anyone understand why
>> >     perl -we 'use Apache::Constants; Apache::Constants::OK();'
>> > causes this problem?
>> what version of mod_perl are you using? '
>mod_perl 1.21,  perl 5.00503

This reminds me of a problem that we had under mod_perl: I'm not sure it
exists in later versions, and if this has anything to do with your problem.
 Just in case it might help you, here is how this would go:

package MyPackage::SubModule;
sub new { my $self = {}; bless $self; $self }

package MyPackage;
sub new { my $self = {}; bless $self; $self }
sub SubModule { MyPackage::SubModule->new( @_ ) }
    ^^^^^^^^^              ^^^^^^^^^
For some reason with _some_ combinations of Perl and mod_perl, the
following code would recurse infinitely and cause the "Deep recursion"
error message:

$mypackage = new MyPackage;
$submodule = $mypackage->SubModule( @parameters );

However, if you would write SubModule like this:

sub SubModule { 'MyPackage::SubModule'->new( @_ ) }
                ^                    ^
there was no problem.  This would indicate to me that there is some kind of
compile-time optimization in the version of Perl/mod_perl that incorrectly
assumes that "MyPackage::SubModule" is a subroutine reference, where in
fact it is a class reference.  By putting the class reference between
single quotes, the optimization is apparently by-passed and the problem
disappeared.


Hope this helps.


Elizabeth Mattijsen
Integra Netherlands

Reply via email to