You are a star!!!

I ammended your syntax slightly
 and did this:-

my $sub_string='sub { '.$handler_bf.'($r) };';
$r->push_handlers(PerlHandler => eval $sub_string);

Otherwise The handler routine of my handler module doesn't get passed the
Apache object as it's first argument.

It seems to work fine. Thank you.

One point to ask, Is this less efficient, as I'm passing an anonynmous
subroutine around rather than a code reference?

I can finally go to bed :-)

Kind regards

Marty



----- Original Message -----
From: "Marcin Kasperski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 18, 2002 12:55 AM
Subject: Re: problem with $r->push_handlers()


> > MyMod::Apache::Multiplex Matched /test/ to MyMod::Apache::Test
> > (MyMod::Apache::Test) for /
> > mod_perl_push_handlers: Not a subroutine name or CODE reference! at
> > /usr/local/lib/perl//MyMod/Apache/Multiplex.pm line 101.
> > They match
> > (MyMod::Apache::Test) = (MyMod::Apache::Test)
>
> I have observed similar problem myself. I got the same error when I
> wrote in my startup.pl
>
> Apache->push_handlers("PerlChildInitHandler",
>       \&MyApp::Main::on_child_init);
>
> when I replaced it with
>
> Apache->push_handlers("PerlChildInitHandler",
>       sub { MyApp::Main::on_child_init(); });
>
> it works as expected.
>
>
> --
> ( Marcin Kasperski   | You have the right to peace, fun, and
ctive      )
> ( http://www.mk.w.pl |            and enjoyable work.
       )
>
(---------------------------------------------------------------------------
-)
> ( Nie gub zgłoszeń błędów:
p://www.mk.w.pl/narzedzia/narzedzia_bugewid    )
>

Reply via email to