Hello All

I have made a module derived from PerlRun. It overrides only readscript()
method in PerlRun. First I wrote as follows (essencial part only)

    package Apache::PerlRunFake;
    use Apache::PerlRun;
    @ISA = qw(Apache::PerlRun);
    sub readscript {
        ...
    }
    *handler = \&Apache::PerlRun::handler;

But Apache::PerlRun::handler() inclueds following code.

    my $pr = Apache::PerlRun->new($r);

It must be Apache::PerlRunFake->new() in Apache::PerlRunFake. I'm
obliged to copy the whole codes of handler() in PerlRun.pm to
PerlRunFake.pm and modify the above-mentioned part. This will cause a
version problem between Apache::PerlRun::handler() and
Apache::PerlRunFake::handler() in the future.

If handler() in Apache::PerlRun is written as follows,

    sub handler { # only entry
        my $r = shift;
        my $pr = Apache::PerlRun->new($r);
        $pr->handler_body;
    }
    sub handler_body { # contents are here
        my $pr = shift;
        ...
    }

I can write Apache::PerlRunFake as follows,

    package Apache::PerlRunFake;
    use Apache::PerlRun;
    @ISA = qw(Apache::PerlRun);
    sub readscript {
        ...
    }
    sub handler {
        my $r = shift;
        my $pr = Apache::PerlRunFake->new($r);
        $pr->handler_body;
    }

Then version problem will not occur.


Sey Nakajima <[EMAIL PROTECTED]>
Kyoto, Japan

Reply via email to